Receive notification when doc finished loading

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
dkeith2
User
Posts: 46
Joined: Mon Aug 14, 2017 8:28 pm

Receive notification when doc finished loading

Post by dkeith2 »

Is there an event, callback or any other means of being notified when a document is finished loading?

I've been getting access violations if I try to write to form fields when the document is still loading.

If I wait for a large document to load, usually I won't get any access violations when attempting to write data to form fields.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Receive notification when doc finished loading

Post by Sasha - Tracker Dev Team »

Hello dkeith2,

Try e.document.initialized or e.document.viewingStarted event.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
dkeith2
User
Posts: 46
Joined: Mon Aug 14, 2017 8:28 pm

Re: Receive notification when doc finished loading

Post by dkeith2 »

Thanks. e.document.initialized seems to do the trick.
On another note, I keep getting invalid floating point operation when I call the following:

Code: Select all

    FStream.LoadFromStream(Stream);
    strm := TStreamAdapter.Create(fstream,TStreamOwnership.soReference);
    OpenDocFrom(strm,null); <====Errors out here
    
What's weird about this error is that it is inconsistent. I can run the app, load the child form from the main form, which in turn loads the control. Then I interactively choose the document to load, and open it - either automatically filling the form fields with data or loading data in a 2 step operation of 1) Open pdf... and 2) write data to fields programmatically.

It works up to a point; then it begins to crash with the invalid floating point operation. Also, loading one document usually works fine with no leaks; after opening and closing a few documents I get memory leaks.

First of all, why an invalid floating point operation?

Before I create the control I call CoInitialize; when I am destroying the form I call CoUninitialize.

Sometimes when I write data to the form fields the display doesn't refresh, or not all of the fields get written. Almost as if the control doesn't completely initialize...
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Receive notification when doc finished loading

Post by Sasha - Tracker Dev Team »

Hello dkeith2,

Try doing this:
https://forum.pdf-xchange.com/ ... 15#p103115
Also, this wiki help page here is very useful:
https://sdkhelp.pdf-xchange.com/view/PXV:CoClasses

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply