Hi all,

I'm trying to load an embedded PDF file as a new PDDocument object so I can
read its contents and the way to do it seems to be to get the output stream
from PDStream, convert it to an ByteArrayOutputStream and then load that
directly.

However, when I call the createOutputStream method of my PDStream object,
the output is a COSStream object, not a OutputStream one, as both the
internal method reference and the online documentation suggest it should be
(See:
https://pdfbox.apache.org/docs/2.0.13/javadocs/org/apache/pdfbox/pdmodel/common/PDStream.html#createOutputStream--
).

Is this an incorrect documentation or implementation? What can I do to
overcome this issue and load the COSStream object as a new document?

I'm using PDFBox 2.0.23, by the way.

Regards, Gilad.

Reply via email to