pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: NullPointer in StandardSecurityHandler
Date Wed, 22 Apr 2015 06:00:03 GMT
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-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


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


Mime
View raw message