[ 
https://issues.apache.org/jira/browse/PDFBOX-3113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15011731#comment-15011731
 ] 

John Hewson commented on PDFBOX-3113:
-------------------------------------

Don't do that. That's for adding a new steam to a PDF.  PDPage#etContents() has 
been replaced with PDPage#getContentStreams() in 2.0 because in 1.8 we lied and 
pretended that a page has a single content stream, however that's not 
necessarily true, it can have an array of content streams. In 1.8 this lie was 
facilitated by COSStreamArray, which violated the PDStream contract in many 
ways, so it was removed in 2.0 and instead we give you access to the multiple 
PDStream objects which can make up a page's contents.

> Scratch file already closed using PDStream
> ------------------------------------------
>
>                 Key: PDFBOX-3113
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3113
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>         Attachments: PDFToPDF2.java
>
>
> I get when i try to create a PDStream from a page contents:
> Exception in thread "main" java.io.IOException: Scratch file already closed
>       at org.apache.pdfbox.io.ScratchFile.checkClosed(ScratchFile.java:390
> We used to be able to do:
> PDStream pdStream = page.getContents();



--
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