You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Fossestøl, Vegard <Ve...@moller.no> on 2015/10/13 10:06:39 UTC

Problem with pdfbox save(Version 1.8.7 and snapshot 2.0.0)

Hi,

I have encountered a strange problem with pdf box. I'm trying to split a Larger PDF file into smaller ones. The split function does work, but when saving the new generated pdf to disk, there's a problem. I get this errormessage:
COSStream has been closed and cannot be read. Perhaps its enclosing PDDocument has been closed?

But I've sysout'ed the state of the document which say's it's not closed. And as well, the program runs properly in debug mode. I'm currently running eclipse on a Websphere applicatation Server 7. And I've tried to fix the problem for days now. But converting the PDDocument to a bytearray, and everything that is possible. As well I've tried to just use your save function that takes a filename as a parameter (Which is extremely slow, you should use a filebuffer and bytearray to save it).

Hope you have the time to help me as soon as possible. Btw, get the same error at version 1.8.7 and 2.0.0

Med vennlig hilsen
Vegard Fossestøl
Tlf: 916 32 699
Konsulent Møllergruppen