pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Munn <and...@nmedia.net>
Subject Re: NullPointer in StandardSecurityHandler
Date Tue, 21 Apr 2015 23:37:03 GMT
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


Mime
View raw message