Open Parameters

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

Open Parameters

Post by abc123abc123 »

On point 2.2.1.33 in your help i found the following:

Source file name, or valid URL, or Stream Object. The source-URL can
contains some special open-actions(see PDF Open Parameters).
Some examples:
http://www.mysite.com/test.pdf#page=2&zoom=150
file:///C:/test.pdf
C:\test.pdf

Now i want to open a pdf with the parameter page=5. what do i need to do this. I tried different things for example:

pdfViewer.openDocument("C:\...\test.pdf#page=5");

i only get an error that says the file C:\...\test.pdf#page=5 could not be found
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Open Parameters

Post by Vasyl - PDF-XChange »

You cannot use this method for local files.
For your case you should use:

Code: Select all

int docId;
pdfViewer.openDocument("C:\...\test.pdf", 0, out docId);
if (docId > 0)
{
    pdfViewer.SetDocumentProperty(docId, "Pages.Current", 5);
}
...
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: Open Parameters

Post by abc123abc123 »

In the help i can find the method "36010" to go to a named Bookmark.

When i try it i get the message : The command is disabled Currently.

No i thougt i could enable it so: _PdfViewer.SetProperty("Commands[#36010].state", "online");

What do I need to jump to a named destination. Is there an other Command?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Open Parameters

Post by Stefan - PDF-XChange »

Hello abc123abc123,

I have asked the guys for some additional comments, but I believe that you can use JS code and the gotoNamedDest method for that.

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

Re: Open Parameters

Post by abc123abc123 »

I have now a Method called runJavaScript and in this i have an object Bookmark and a method gotonameddest.

How can I bring them together? I found no examples in the Help
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3586
Joined: Thu Jul 08, 2004 10:36 pm

Re: Open Parameters

Post by Ivan - Tracker Software »

if you have bookmark in JS, try to use its execute() method.
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Open Parameters

Post by Vasyl - PDF-XChange »

The UI-command #36010 (GotoBookmark) is working only with our bookmarks-view and if any bookmark is already selected in this view. This command cannot help you...
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.