Open Document from binary string without local download

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

milonass
User
Posts: 35
Joined: Tue Oct 06, 2015 1:09 pm

Open Document from binary string without local download

Post by milonass »

Is it possible to open a document by transferring directly the binary string, e.g. using doVerb( ' ','OpenDocument',data,...)?

Thanks.

Thomas
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London

Re: Open Document from binary string without local download

Post by Tracker Supp-Stefan »

Hello Thomas,

You need to specify the "UseStreamsDirectly" flag:

Code: Select all

SetProperty("Documents.UseStreamsDirectly", 0, 0)
Regards,
Stefan
milonass
User
Posts: 35
Joined: Tue Oct 06, 2015 1:09 pm

Re: Open Document from binary string without local download

Post by milonass »

Thank you. How do I supply the variant Parameter? Is it a BSTR?

Thank you.

T.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Open Document from binary string without local download

Post by Vasyl-Tracker Dev Team »

Hi Thomas.
Is it possible to open a document by transferring directly the binary string, e.g. using doVerb( ' ','OpenDocument',data,...)?
No, the document source can be:

1. path to file on the disk
2. URL to remote file
3. IStream-based object (good alternative for your case, look to our SDK examples to see how to pass stream)

Also, as mentioned above - you may set the special property that forces viewer activeX to keep strong relation between input-stream and opened document. This relation is required for regular end-user's 'Save Doc to Source' feature. Otherwise, when user clicked 'Save' button for document that was loaded from stream - it will show the 'Save As..' dialog instead of simple and silent saving to the source-stream.

In C++:

Code: Select all

ATL::CComBSTR propName("Documents.UseStreamsDirectly");
ATL::CComVariant propVal(true); // == ATL::CComVariant propVal(1); == ATL::CComVariant propVal("true");
pdfViewer.SetProperty(propName, propVal, 0);
In C#:

Code: Select all

pdfViewer.SetProperty("Documents.UseStreamsDirectly", true, 0);
// == pdfViewer.SetProperty("Documents.UseStreamsDirectly", 1, 0);
// == pdfViewer.SetProperty("Documents.UseStreamsDirectly", "true", 0);
HTH
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.