Java - Getting contents of PDF Document to an InputStream?

Hello,

Is there a way to get the contents of a PDF Document object and write it to a Stream or byte array in Java?

@jmmorgan,

You may use Aspose.PDF for Java for your requirements. For example, see the document with example code on how to open a PDF document from stream via Aspose.PDF for Java API. Similarly you may check the document on how to save PDF document to stream.