Hi,

Fixed. The difference is that you now get an exception telling you what to do.

Tilman

Am 22.04.2015 um 08:00 schrieb Tilman Hausherr:
https://issues.apache.org/jira/browse/PDFBOX-2769
created.

In the meantime, either follow the instructions at https://pdfbox.apache.org/1.8/cookbook/encryption.html , or call setAllSecurityToBeRemoved(true) before saving your doc.

And yes, your doc is encrypted, but with an empty user psw.

Tilman



Am 22.04.2015 um 01:37 schrieb Andrew Munn:
On Wed, 22 Apr 2015, Tilman Hausherr wrote:

I think I remember seeing this before... happens when calling save with some incomplete encryption settings. Could you please post the shortest possible code that reproduces the error, the version you are using, and upload the PDF
you are using (if applicable) somewhere.

I'm not trying to do any encryption.  That's the odd part.  Code is just
this:

public void thisWillFail() {
         Path f = Paths.get("c:\\temp\\test.pdf");
         try {
             PDDocument document = PDDocument.load(f.toFile());
             File file = Paths.get("c:\\temp\\fail.pdf").toFile();
             try {
                 document.save(file); // <-- EXCEPTION
             } catch (NullPointerException e) {
                 e.printStackTrace();
                 System.exit(-123);
             }
             document.close();
         } catch (IOException e) {
             e.printStackTrace();
         }
     }

PDF is
http://www.optionsclearing.com/market-data/series/ess-record-layout.pdf

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to