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

John Hewson commented on PDFBOX-2206:
-------------------------------------

This is why RAII is a good thing, so we don't end up with a constructor that 
leaves an object unusable. I guess we need ConformingPDFParser to pass the 
trailer to the constructor.

> Cannot save a document which has been closed
> --------------------------------------------
>
>                 Key: PDFBOX-2206
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2206
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>             Fix For: 2.0.0
>
>
> Any pdf gives:
> java -jar ~/pdf-box-svn/app/target/pdfbox-app-2.0.0-SNAPSHOT.jar 
> WriteDecodedDoc x.pdf 
> Exception in thread "main" java.io.IOException: Cannot save a document which 
> has been closed
>       at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1230)
>       at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1216)
>       at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1204)
>       at 
> org.apache.pdfbox.tools.WriteDecodedDoc.doIt(WriteDecodedDoc.java:125)
>       at 
> org.apache.pdfbox.tools.WriteDecodedDoc.main(WriteDecodedDoc.java:191)
>       at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:97)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to