Enabling the Document Recovery in the SDK

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
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Enabling the Document Recovery in the SDK

Post by RMan »

While the settings are there and turned on it doesn't appear that the document recovery works with the SDK? I was testing with the CSharp\FullDemo sample.

Is there an initialization or something that needs to be done to enable it?
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Enabling the Document Recovery in the SDK

Post by Vasyl-Tracker Dev Team »

Hi RMan.

Sorry for the delay with the answer. The document recovery is disabled in the SDK mode, at the moment. Yes, you may see Recovery-options on the Prefs but internally the Recovery-stuff is turned off for some reason.

Cheers.
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.
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

It looks like this still hasn't been included in the 9.5.366.0 build?

It looks like some more string ID's and again it creates the .tmp files and folders but I don't see it creating the PDFXRecoveryInfo.xml files or populating the pane if you do End Task the program through the Task Manager.

Any chance we can get this pushed to the top of the list since it's so close to working?
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

Also do you have any recommendations on how we can determine when the user is not adding markups or such to perform a background save ourselves?

I realize doing a SaveAsCopy can take some time but most of the time you don't even notice it minus the fact that any annotations selected on the screen are unselected after the save of it they are typing in a textbox or something the cursor gets lots.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Enabling the Document Recovery in the SDK

Post by Vasyl-Tracker Dev Team »

Hi RMan.

I can confirm that Recovery-feature is still not included in SDK.
To try to make your own recovery-solution you may to intercept the e.document.modStateChanged event. The ActiveX Control fires it each time when document's modified-state is changed during editing the doc by user or/and via Undo/Redo. To check if the document is changed - you may use the PXV_Document::get_Modified.

And yes, using the SaveAsCopy stops the text-editing process for comments or for text on the page. And you cannot avoid it, unfortunately.

We will discuss with the team about including the Recovery-stuff in SDK mode, but at the moment I cannot promise that we will definitely do it...

Cheers.
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.
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

Any word on this by chance? Since it's so close it would be great to have it enabled in the SDK also.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Enabling the Document Recovery in the SDK

Post by Vasyl-Tracker Dev Team »

Hi All.

In the new upcoming build you will be able to enable the Recovery-functionality via the:

Code: Select all

PDFXEdit.ICabNode pr = pdfCtl.Inst.Settings["Docs.Recovery"];

pr["Enable"] = true; 
// - to enable periodical auto-saving changes from opened docs;
// it saves changes not to the original files, but to the temp folder, as recovery-data

pr["Interval"] = 300; 
// - every 300 seconds (5 minutes) editor will try to store new document changes to the recovery data

pr["KeepUnsavedChanges"] = true; 
// - it enables option to keep changes from doc when the doc was
// mistakenly closed by user without saving that changes

pr["ShowRecoveryPanel"] = true; 
// - to autoshow the Recovery pane when it has the recovery items.

pdfCtl.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Documents);
Also the end-user will be able to enable/setup the Recovery-feature via Preferences->Documents...

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.
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

Awesome to hear thanks so very much.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Enabling the Document Recovery in the SDK

Post by TrackerSupp-Daniel »

:)
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

Unfortunately I tried this in the new 10.1.1.381 build and it still doesn't appear to work. If I End Task on the program from the Task Manager and restart it nothing shows up in the Document Recovery Panel.

Also if I close a PDF without saving it will show up in the Document Recovery Panel but it cannot be recovered with an error that the document cannot be recovered and it looks like it's missing the file name in the Documents Recovery Pane.
DocumentRecoveryError.jpg
DocumentRecoveryError.jpg (14.79 KiB) Viewed 3814 times
DocumentRecoveryPane.jpg
DocumentRecoveryPane.jpg (9.2 KiB) Viewed 3814 times
And then when I do close the program and reopen it the Document Recovery Pane is empty again.

Here's the settings that I set in the Preferences.
DocumentRecoveryPreferences.jpg
DocumentRecoveryPreferences.jpg (23.76 KiB) Viewed 3814 times
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Enabling the Document Recovery in the SDK

Post by Vasyl-Tracker Dev Team »

You are right, unfortunately :(. There is kind of a bug that breaks the Recovery feature in SDK mode. We are now investigating it and will try to fix it in the next build...
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.
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

So close it looks like in the 10.2.0.384 build. Any chance you could please fix the rest of it and update the SDK since you just released it?

It looks like the files are being created properly and listed for the ones that keep the recovery information when closing and discarding changes in the current session. So it appears to be working correctly in the current session.

But upon closing and reopening our program it does not list the recovery documents even though they are still listed in the folder. I tried firing the e.docsRecovery.listChanged event but no luck there either. So it appears you are just missing the loop to restore the recoveryView list of files from the folder.

I also see some strings like these but wasn't sure how I might use them to populate the recovery list.
recoveryView.file
recoveryView.file.new
recoveryView.crash
recoveryView.noSave
recoveryView.recovered
recoveryView.size

Also it would be nice to have a way to force the list to be repopulated if say we wanted to change the default location to store the files using the PXV_StdFolder_Temp is what it looks to use for it since there is no folder enum for the recovery files.
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

I also forgot to mention that I also tested it with recompiling the CSharp\FullDemo sample and the same results.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Enabling the Document Recovery in the SDK

Post by Vasyl-Tracker Dev Team »

RMan wrote: But upon closing and reopening our program it does not list the recovery documents even though they are still listed in the folder.
It will be fixed in the upcoming 385 build.
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.
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Enabling the Document Recovery in the SDK

Post by RMan »

Thank you and the team so very much it appears to be working great in the new build. Makes my life and our users so much easier now!!!
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Enabling the Document Recovery in the SDK

Post by TrackerSupp-Daniel »

:)
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply