That worked. Thanks, Alan -------------------------------------------------- From: "Andreas Lehmkühler" <[email protected]> Sent: Sunday, July 05, 2009 7:36 AM To: <[email protected]> Subject: Re: java.io.IOException: The handle is invalid
Andreas, When you said "copy the page", were you referring to something like this? PDPage imported = OutputDoc.importPage(page); imported.setCropBox(page.findCropBox()); imported.setMediaBox(page.findMediaBox()); imported.setResources(page.findResources()); imported.setRotation(page.findRotation()); I took this from the processNextPage method in org.apache.pdfbox.util.Splitter,Yes, that was the idea. I thought it will be sufficient to copy the pages with that code to double the resources to become independent from the input-doc. But obviously it didn't work. There still has to be a dependency. Try to close the input-doc after writing the output-doc as it is done in PDFSplit. Andreas Lehmkühler
