Restoring last document location

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Restoring last document location

Post by aaronmcgranaghan »

In my C# application I am trying to restore the last location that a document was at.

If my application remains open, then opening the same document does in fact remember the last location the document was at.

However, if I close my application and restart it, and then open the document, it always loads at the start of the document and not last place/page it was at.

I have set:

Code: Select all

SetProperty("Documents.RestoreLastPageDisp", 1);
SetProperty("Documents.RestoreLastView", 1);
...but this does not seem to help.

Is it possible to make my application remember a documents last position, even when the application has been closed and reopened?

Thanks,

Aaron
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Restoring last document location

Post by Vasyl - PDF-XChange »

Hi, Aaron.
Is it possible to make my application remember a documents last position, even when the application has been closed and reopened?
Yes, exists standard method for it. You must use:

- pdfViewer.SaveSettings(fileOrSysRegistyKey) before closing of your application
- pdfViewer.LoadSettings(fileOrSysRegistyKey) at start of your program, after creation of our control on your form.

Look to our SDK for help and examples.

HTH.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
aaronmcgranaghan
User
Posts: 15
Joined: Wed Oct 31, 2012 9:58 am

Re: Restoring last document location

Post by aaronmcgranaghan »

Vasyl-Tracker Dev Team wrote:Hi, Aaron.
Is it possible to make my application remember a documents last position, even when the application has been closed and reopened?
Yes, exists standard method for it. You must use:

- pdfViewer.SaveSettings(fileOrSysRegistyKey) before closing of your application
- pdfViewer.LoadSettings(fileOrSysRegistyKey) at start of your program, after creation of our control on your form.

Look to our SDK for help and examples.

HTH.
Again, thanks! Work perfectly!
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Restoring last document location

Post by Stefan - PDF-XChange »

:)
jenny82
User
Posts: 1
Joined: Wed Jan 30, 2013 8:25 am

Re: Restoring last document location

Post by jenny82 »

Thank you, I also encountered similar cases
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7361
Joined: Wed Mar 25, 2009 10:37 pm

Re: Restoring last document location

Post by Paul - PDF-XChange »

Hi jenny82

so do you need anything from us or is this all OK for you then?
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com