Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4808

Issue while merging documents

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 2.0.9
    • None
    • Crypto
    • None
    • Important

    Description

       
      I am trying PDFBox for merging multiple PDF documents. Code is below. I am facing an issue. For a few PDF files i am getting "java.io.IOException: java.security.InvalidKeyException: Illegal key size". I am not sure what is going on. Could someone please help me ?

      Could you please also let me know if PDFBox has restriction on PDFstandards/types etc ?
       
      {{ PDFMergerUtility PDFutility = new PDFMergerUtility();ByteArrayOutputStream mergedPdf = new ByteArrayOutputStream();PDFutility.addSources(pdfDocs);PDFutility.setDestinationStream(mergedPdf);PDFutility.mergeDocuments();}}

      {{}}

      Caused by: java.io.IOException: java.security.InvalidKeyException: Illegal key size at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.computeEncryptedKeyRev56(StandardSecurityHandler.java:779) at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.computeEncryptedKey(StandardSecurityHandler.java:681) at org.apache.pdfbox.pdmodel.encryption.StandardSecurityHandler.prepareForDecryption(StandardSecurityHandler.java:256) at org.apache.pdfbox.pdfparser.COSParser.prepareDecryption(COSParser.java:2929) at org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:286) at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:173) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:226) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1222) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1140) at org.apache.pdfbox.multipdf.PDFMergerUtility.legacyMergeDocuments(PDFMergerUtility.java:455) at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:346) at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:330){{}}

      Attachments

        1. screenshot-1.png
          113 kB
          Tilman Hausherr
        2. screenshot-2.png
          77 kB
          Tilman Hausherr

        Activity

          People

            Unassigned Unassigned
            Sunile Sunil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: