[ 
https://issues.apache.org/jira/browse/PDFBOX-3312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr resolved PDFBOX-3312.
-------------------------------------
    Resolution: Fixed

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to