Editor in internet browser.

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

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

naseem
User
Posts: 10
Joined: Mon May 06, 2013 5:16 pm

Editor in internet browser.

Post by naseem »

Hello
We are using PDF-XChange Editor in browser and using RunJavaScript to interact with pdf document. We are trying to find answers to the following questions. Can somebody help?

1.What event is being referenced when menu item is disabled
2.How do you disable toolbars and menu items
3. what event is triggered when the PDF is Modified (Inserts, Reordering, Deletions).
4. Can we capture the events
If so, What events can be captured.

5.Can we disable reordering pages.
6.Can we disable the context menu (right click)

Thanks
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK

Re: Editor in internet browser.

Post by Will - Tracker Supp »

Hi Naseem,

Thanks for the post - this isn't something that can be done with JavaScript, the only way that this can be done is with one of our SDKs, through which you will have to compile your own application with the specified parameters. At the moment, we don't have an SDK available for the Editor, due to the fact that it is only a partial release.

This can be done with the Viewer SDKs that we have available from our main site
https://www.pdf-xchange.com

Hope that helps!
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

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
naseem
User
Posts: 10
Joined: Mon May 06, 2013 5:16 pm

Re: Editor in internet browser.

Post by naseem »

Thanks Will. I have another question.

We use RunJavaScript for annotation and other operations but we cannot read the "out Result" parameter in client javascript. As a workaround we store the result in "Keyword" property inside RunJavaScript, save the document and read the "Keyword" property back in client javascript.

Can we use the "global" static object to achieve this? if possible can you explain a better way of reading the result back in client script?

Thanks
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Editor in internet browser.

Post by Vasyl-Tracker Dev Team »

Hi, naseem.
We are using PDF-XChange Editor in browser and using RunJavaScript to interact with pdf document.
You mean the "PDF-XChange Viewer ActiveX SDK" ? because the Editor's SDK still not published for now.. :wink:
1.What event is being referenced when menu item is disabled
I'm afraid there's not any event for this.. The any menu item can be disabled/enabled internally in any moment..
2.How do you disable toolbars and menu items
It is easy to turn off any command item (doesn't matter where it is: in menu or in toolbar):

Code: Select all

pdfViewer.SetProperty("Commands[#" + ToStr(cmdID) + "].State", "Offline", 0);
//or
pdfViewer.SetProperty("Commands[" + cmdName + "].State", "Offline", 0);
to restore the normal state of command item - set "Online" value to the "State" property of corresponding command.
3. what event is triggered when the PDF is Modified (Inserts, Reordering, Deletions).
You may handle the changing of special document's property by standard active-X event-handler IPDFXCviewEvents::OnEvent(..). Some pseudocode:

Code: Select all

youreventhandler OnEvent(type, name, ..)
{
   if (type == PXCVA_OnPropertyChanged)
   {
       if (HasSuffix(name, ".Modified"))  // name == "Documents[#<docID>].Modified" 
       {
            bool bModified = pdfViewer.Property(name, 0);
            ...
       }
   }
}
5.Can we disable reordering pages.
You may hide (is hidden by default) the "Page Thumbnails" pane (the "Documents[#docID].View.Panes["Thumbnails"].Visible" property). Because in this pane user can reorder pages (if it is allowed by document's security) by simple drag&drop and this feature cannot be disabled in current implementation.
6.Can we disable the context menu (right click)
Yes, by:

Code: Select all

pdfViewer.SetProperty("General.DenyAllContextMenus", "true", 0);
We use RunJavaScript for annotation and other operations but we cannot read the "out Result" parameter in client javascript.
Exists other way for you:

Code: Select all

pdfViewer.SetProperty("JavaScript.UseExecResult", "true", 0); // call once only, enables JS-output through special "JavaScript.ExecResult" property
...
pdfViewer.RunJavaScript(...);
string res = pdfViewer.Property("JavaScript.ExecResult", 0);
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.