Last Document

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

abc123abc123
User
Posts: 35
Joined: Mon Oct 17, 2011 2:36 pm

Last Document

Post by abc123abc123 »

Hi,

i open an document and then there is a link in it that opens a new document is there any command that brings me back to the point or document where I come from?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Last Document

Post by Stefan - PDF-XChange »

Hello abc123abc123,

I've asked for some help and advise from our devs, and we will post in this topic a bit later.

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

Re: Last Document

Post by Vasyl - PDF-XChange »

Try to use the following UI-command:

Code: Select all

pdfViewer.DoVerb("", "ExecuteCommand", "GoBack", null, PXCVA_Sync);
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.
abc123abc123
User
Posts: 35
Joined: Mon Oct 17, 2011 2:36 pm

Re: Last Document

Post by abc123abc123 »

It works but with some problems: I open a new Document now i scroll in this document to an other position and the i press last document i jump at the first time back to the position where i come from when i scrolled. At the second time i press the last doc button i go back to my first document.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2445
Joined: Thu Jun 30, 2005 4:11 pm

Re: Last Document

Post by Vasyl - PDF-XChange »

Ok. You may try to use other way for your case (pseudocode):

Code: Select all

array_of<string> backHistory;

youreventhandler OnEvent(Type, Name, ...)
{
    if (Type == PXCVA_OnDisplayPrompt)
    {
        string srcName;
        if (Name == "Prompts.ConfirmOpenSite")
        {
            pdfViewer.GetProperty(Name + ".Name", out srcName, 0);
        }
        else if (Name == "Prompts.ConfirmLaunchFile")
        {
            pdfViewer.GetProperty(Name + ".FileName", out srcName, 0);
        }
        if (!srcName.IsEmpty())
        {
            backHistory.add(srcName);
        }
    }
}
................................................
yourform
{
    OnBackBtn()
    {
         if (!backHistory.IsEmpty())
         {
               string srcName = backHistory.GetLast();
               backHistory.RemoveLast();
               pdfViewer.OpenDocument(srcName);
         }
    }
}
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.
abc123abc123
User
Posts: 35
Joined: Mon Oct 17, 2011 2:36 pm

Re: Last Document

Post by abc123abc123 »

thanks for the hint. Now I got it working...
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19885
Joined: Mon Jan 12, 2009 8:07 am

Re: Last Document

Post by Stefan - PDF-XChange »

Pleasure to hear that abc123 :)

Cheers,
Stefan