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

java.io.IOException: Error: source PDF is encrypted, can't append encrypted PDF documents

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • Utilities
    • Windows 8.1 x64, JDK 7u80 32 bits, Netbeans 8.1, PDFBox 2.0.0RC2 jar
    • Important

    Description

      In the release notes of PDFBox 2.0.0 RC2 we can read that (PDFBOX-1656) PDFMergerUtility is able to merge encrypted files. I have some files protected against modification with a password (users are allowed to open and print the file but its content is locked). I'm trying to merge those files into a single one but without success.

      1. Adding source files.
      2. Setting the destination filename.
      3. Calling mergeDocuments().

      Result is : Exception in thread "main" java.io.IOException: Error: source PDF is encrypted, can't append encrypted PDF documents.
      at org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:255)
      at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:201)

      Note : PDDocument.load() works if I need to print the files.
      (Bonus Question : How could I decrypt a document before appending it to a new one (decrypt and openProtection are not used anymore))

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            blacklord049 Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: