I am working with the viewer SDK and passing the PDF document contents from my application into a MemoryStream. I then create an IStreamWrapper and pass it the initialized MemoryStream. The document opens quickly and it appears to work well. I have noted that the memory usage for my application, as shown in the Windows Taskmanager, appears to grow when the document is in the viewer, but when I call CloseDocument the process size does not decrease.
My example:
Code: Select all
mstrPDFDoc = new MemoryStream();
// Load PDF document into mstrPDFDoc ..
IStreamWrapper istr = new IStreamWrapper(mstrPDFDoc);
object varg1 = istr;
vArr[0] = varg1;
vDataIn = vArr;
object OutPar;
axCoPDFXCview1.SetProperty("Documents.UseStreamsDirectly", 1, 0);
axCoPDFXCview1.DoVerb(null, "OpenDocument", vDataIn, out OutPar, 0);
Am I correct that using Documents.UseStreamsDirectly = 1 will cause the viewer to access the document contents using the iStream and not create a temporary copy on the disk?
What does it mean when the documentation says it will “capture the stream object” and use it for any writes that occur?
When I call “CloseDocument” will it release the resources for the stream (including the memory stream)?
Thanks,
Chris