Javascript GetSelectedPageThumbnails

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

mr_steph
User
Posts: 52
Joined: Tue Jul 22, 2008 8:18 am

Javascript GetSelectedPageThumbnails

Post by mr_steph »

Hello,

i trying to extract number of selected pages in the thumbnails panel to make a test before an action.

I use Javascript to make it but i can't get this value i get all times an error.
I trying different methods to make it but they give me the same result, an error.

Code: Select all

PDFView.DoVerb("Documents[#"+DocID+"].View.Panes[\"Thumbnails\"].GetSelectedPageThumbnails", "get", 0, 0);
PDFView.Property("Documents[#"+DocID+"].View.Panes[\"Thumbnails\"].GetSelectedPageThumbnails", 0);
PDFView.DoVerb("Documents[#"+DocID+"].View.Panes[\"Thumbnails\"]","ExecuteCommand", "GetSelectedPageThumbnails", 0);
PDFView.DoVerb(DocID, "ExecuteCommand", "Documents[#"+DocID+"].View.Panes[\"Thumbnails\"].GetSelectedPageThumbnails", 0);
I hope you can help me.
Last edited by mr_steph on Wed Sep 05, 2012 12:39 pm, edited 1 time in total.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Javascript GetSelectedPageThumbnails

Post by Stefan - PDF-XChange »

Hello Mr Steph,

have you tried the DoDocumentVerb method?
In pseudocode:

Code: Select all

...
DoDocumentVerb(docId, "GetSelectedPageThumbnails", DataIn, DataOut, 0);
int firstPageThumbSel = DataOut[0];
int secondPageThumbSel = DataOut[1];
...
mr_steph
User
Posts: 52
Joined: Tue Jul 22, 2008 8:18 am

Re: Javascript GetSelectedPageThumbnails

Post by mr_steph »

Thanks for you quickly answer.

I try the "DoDocumentVerb" like the pseudo code give into the documentation but in Javascript this method is "undefined" when i trying to use them.

When i use this code:

Code: Select all

PDFView.SetProperty("Operations.ExtractPages.RangeType","Selected",0)
PDFView.SetProperty("Operations.ExtractPages.DeleteAfterExtract",1,0)
PDFView.DoVerb("Documents[#"+DocIDOrigin+"]","ExtractPages", 0, 0, 2)
the api is able to detect selected thumbnails so how i can get the "selected" page?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Javascript GetSelectedPageThumbnails

Post by Stefan - PDF-XChange »

Hi mr_steph,

I just discussed your problem with one of my colleagues from the dev team, and his answer was that unfortunately JS does not support output parameters, so you cannot get a result form a method of our ActiveX, and there is no way to make the GetSelectedPageThumbnails work with JS.

Regards,
Stefan
mr_steph
User
Posts: 52
Joined: Tue Jul 22, 2008 8:18 am

Re: Javascript GetSelectedPageThumbnails

Post by mr_steph »

Thanks for your answer.

So it's impossible to get number of selected thumbnails with javascript API?
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Javascript GetSelectedPageThumbnails

Post by Stefan - PDF-XChange »

Hi mr_steph,

Sorry but no - you will need to use a different programming language if possible to achieve that.

Best,
Stefan