Re: COSStream has been closed exception on simple copy

2021-10-21 Thread Thad Humphries
I seem to have a workaround. The solution is that when a PDF page has markup, use PDFRenderer to create a BufferedImage of the page at 300dpi, add the markup to the image (adjusting the markup to 300dpi), add the image to a new PDpage, and add that new page to outDocument. If there is no markup, I

Re: COSStream has been closed exception on simple copy

2021-10-21 Thread Thad Humphries
Yes, I can do that. It was meant as a simple illustration. The problem returns when there are intermediate PDDocuments inside the for-loop I must create intermediary PDDocuments in order to Overlay a BufferedImage onto each page. Even that can work if the overlay is the same for each page *and* I

Re: COSStream has been closed exception on simple copy

2021-10-21 Thread Tilman Hausherr
close inDocument after saving the other. Tilman Am 20.10.2021 um 21:15 schrieb Thad Humphries: I am using PDFBox 2.0.24. I am attempting to copy a PDF file to a new PDDocument and save that new document. The eventual goal is to use Overlay to overlay various images onto pages of the old

Re: COSStream has been closed exception on simple copy

2021-10-20 Thread Thad Humphries
Am I seeing this bug? https://issues.apache.org/jira/browse/PDFBOX-3280 If so, I'm not seeing any successful workaround: not with the PDFCloneUtility, not with "importedPage.setResources(pdPage.getResources())", nor with a combination of the two. Might 3.0.0-alpha2 have a solution? On Wed, Oct