PDF file IO through a custom class?

Q: Hi, is there a way to get PDFNet to do all it's file IO through a
custom class?
----

A:
Using PDFNet you can read or write PDF documents in memory (for an
example, please see PDFDocMemory sample project -
http://www.pdftron.com/net/samplecode.html#PDFDocMemory).

You can also implement a custom stream derived from
pdftron::Filters::Filter and pass an instance of this class in PDFDoc
constructor. Practically, however this is rarely useful because most
PDF documents have be opened in random access mode (which means that
all data must be available in memory).

Are there any examples of a custom stream derived from pdftron::Filters::Filter? If the PDF document is linearized we the viewer will start displaying even if the whole file is not written to disc yet?

I would like to be able to start displaying the pdf before the full file has been transmitted from the server to the client. The file can be linearized, but will be encrypted. I am trying to learn how to implement our decryption in a derived filter class, so we can start displaying as soon as possible.

Is there an example of doing this?
“You can also implement a custom stream derived from
pdftron::Filters::Filter and pass an instance of this class in PDFDoc
constructor. Practically, however this is rarely useful because most
PDF documents have be opened in random access mode (which means that
all data must be available in memory).”

I was looking at this https://www.pdftron.com/pdfnet/docs/PDFNet/

and the remarks section:

Remarks

if the input stream doesn’t support Seek() operation the document will load whole data stream in memory before parsing. In case of linearized PDF, the document may be parsed on-the-fly while it is being loaded in memory. Note that since StdFile implements Seek() interface, the document does not have to be fully in memory before it is used. Make sure to call InitSecurityHandler() after PDFDoc(…) for encrypted documents.

I am trying to understand how to implement this.

On Tuesday, January 9, 2007 at 6:02:24 PM UTC-5, Support wrote:

Q: Hi, is there a way to get PDFNet to do all it’s file IO through a
custom class?


A:
Using PDFNet you can read or write PDF documents in memory (for an
example, please see PDFDocMemory sample project -
http://www.pdftron.com/net/samplecode.html#PDFDocMemory).

You can also implement a custom stream derived from
pdftron::Filters::Filter and pass an instance of this class in PDFDoc
constructor. Practically, however this is rarely useful because most
PDF documents have be opened in random access mode (which means that
all data must be available in memory).

For C++ please see this forum post.
https://groups.google.com/d/msg/pdfnet-sdk/2_g14ntyZdk/83oRm2aTCAAJ