ClearOperationHistory does not work for "previous"/"next"

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

cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

ClearOperationHistory does not work for "previous"/"next"

Post by cew »

Hi there,

if I load a document A.pdf and open another document named B.pdf, the navigation element (green buttons) "previous" gets active.
In my case, the document A.pdf does not exist anymore because it was just a temporary file.
Now the user clicks on the "previous" command and gets an error that A.pdf does not exist. That's true but not what I want.

I tried to clear the DocumentOperationHistory (Global::OperationsHistoryChanged got raised) using:

Code: Select all

DoDocumentVerb(docID, null, "ClearOperationsHistory", vDataIn, out OutPar, 0);
but this does not work for the navigation commands "<-" and "->"

What can be done?

Best
cew
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by Stefan - PDF-XChange »

Hello Cew,

I noticed that the sample in the manual is with two NULLs after the command name:

...
DoDocumentVerb(docID, NULL, "ClearOperationsHistory", NULL, NULL, 0);
...

So can you check if it works this way - and if not we will check tis further.

Best,
Stefan
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by cew »

Tracker Supp-Stefan wrote: DoDocumentVerb(docID, NULL, "ClearOperationsHistory", NULL, NULL, 0);
This leads to

Code: Select all

The best overloaded method match for 'Roesberg.PDF.Base.AxCoPDFXCview.DoDocumentVerb(int, string, string, object, out object, int)' has some invalid arguments	
Argument 5: cannot convert from '<null>' to 'out object'
With my source code the history will be cleared. Undo/Redo will be disabled after that clear. But the previous/next commands are still enabled.
Tracker Supp-Stefan wrote: So can you check if it works this way - and if not we will check tis further.
It's your turn :wink:

Best,
cew
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by Stefan - PDF-XChange »

Thanks!

Checking at our end! :)

Best,
Stefan
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: ClearOperationHistory does not work for "previous"/"next

Post by Vasyl - PDF-XChange »

Hi, cew.
I tried to clear the DocumentOperationHistory (Global::OperationsHistoryChanged got raised).
Why have you decided that document navigation features "back"/"forward" are the same as "Undo"/"Redo" features?
Currently the "ClearViewHistory" feature is inaccessible for developers, you can disable "back"/"forward" only. To disable it use:

Code: Select all

pdfViewer.SetProperty("Commands["GoBack"].State", "offline", 0);
pdfViewer.SetProperty("Commands["GoForward"].State", "offline", 0);
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.
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by cew »

Hi Vasyl,
Currently the "ClearViewHistory" feature is inaccessible for developers, you can disable "back"/"forward" only. To disable it use:

Code: Select all

pdfViewer.SetProperty("Commands["GoBack"].State", "offline", 0);
pdfViewer.SetProperty("Commands["GoForward"].State", "offline", 0);
I don't get it to work. If I close the active document and open another, the back button is still active.
Also I tried to disable the "GoBackDoc"/"GoForwardDoc" commands. Nothing changed.

What's wrong?

Best,
cew
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: ClearOperationHistory does not work for "previous"/"next

Post by Vasyl - PDF-XChange »

Please use next method:

Code: Select all

// "Back"/"Forward"
pdfViewer.SetProperty("Commands[#32316].State", "offline", 0); // name - "GoBack"
pdfViewer.SetProperty("Commands[#32317].State", "offline", 0); // name - "GoForward"
// "Previous View"/"Next View"
pdfViewer.SetProperty("Commands[#32890].State", "offline", 0); // name - "GoBack"
pdfViewer.SetProperty("Commands[#32891].State", "offline", 0); // name - "GoForward"
As you see the two pairs of UI-commands have a the same names and the code:

Code: Select all

pdfViewer.SetProperty("Commands["GoBack"].State", "offline", 0);
pdfViewer.SetProperty("Commands["GoForward"].State", "offline", 0);
-changes state of "Previous View"/"Next View" pair only...

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.
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by cew »

Vasyl-Tracker Dev Team wrote: [...]
HTH.
Yes, TH! :D

Tank you!

Best,
cew
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by John - Tracker Supp »

No 'Tank' you Cew :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
cew
User
Posts: 213
Joined: Tue Feb 01, 2011 8:14 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by cew »

John - Tracker Supp wrote:No 'Tank' you Cew :)
Ooops!
Here it is: "h"
:wink:

Best,
cew
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: ClearOperationHistory does not work for "previous"/"next

Post by John - Tracker Supp »

:) thanks Cew - now I feel complete ! :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com