How to tell when PDF is fully loaded/read

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
JGForwick
User
Posts: 16
Joined: Fri Jan 21, 2011 7:17 pm

How to tell when PDF is fully loaded/read

Post by JGForwick »

Is there a simple way (ie property or method) to tell when a PDF has been completely loaded/opened by the control?

My scenario is that a filestream is being created from a temporary file and then the file stream is passed to the control for opening...

Code: Select all

pdfCtrl.OpenDocFrom(stream);
After the file is opened we do cleanup on the stream AND the temp document (close the stream and delete the document) however it appears as the OpenDocFrom() is async and therefore when the cleanup occurs right after the file may not be completely opened causing errors (incomplete document loaded, unable to delete source temp file)

I can write custom code to constantly check whether the source file is in use but that seems a little clumsy. Hoping there is simply a property or event on the control that can be checked to indicate that a file/stream has been completely read and loaded by the control.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to tell when PDF is fully loaded/read

Post by Sasha - Tracker Dev Team »

Hello JGForwick,

The e.documentView.ready event should be an OK place for your case.

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