You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/04/09 17:33:25 UTC

[jira] [Created] (PDFBOX-3312) NPE in saveIncremental() / fix javadoc

Tilman Hausherr created PDFBOX-3312:
---------------------------------------

             Summary: NPE in saveIncremental() / fix javadoc
                 Key: PDFBOX-3312
                 URL: https://issues.apache.org/jira/browse/PDFBOX-3312
             Project: PDFBox
          Issue Type: Bug
          Components: Signing
    Affects Versions: 2.0.0, 2.0.1, 2.1.0
            Reporter: Tilman Hausherr
            Assignee: Tilman Hausherr
             Fix For: 2.0.1, 2.1.0


[~cbremaud] mentioned in PDFBOX-2716:
{quote}
You may want to change the javadoc because this is now possible to use saveIncremental() function on PDDocument loaded with InputStream.
{quote}
I checked this and yes, it works with a stream, because since the rewrite of the caching stuff, the stream contents are stored in a file or in memory when the PDF is loaded from a stream. The javadoc wasn't changed in rev 1688018.

Then I tried this:
{code}
new PDDocument().saveIncremental(new FileOutputStream(new File("huhu.pdf")));
{code}
this results in an NPE. So I'm adding a check in saveIncremental(), similar to the check that was removed in 1688018, likely because nobody thought about the weird code above.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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