Do Search from the code

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

anti_g
User
Posts: 22
Joined: Thu Apr 02, 2009 9:55 am

Do Search from the code

Post by anti_g »

In an open document I do the following

Code: Select all

    Dim textForSearch as String  
    Dim vArr(2) As Variant
    vArr(0) = 57636
    vArr(1) = textForSearch
    vDataIn = vArr

    myPDF.DoVerb "", "ExecuteCommand", vDataIn, vDataOut, 0 'Find
    myPDF.DoVerb "", "ExecuteCommand", 32987, 0, 0  'findsearch
with the result that the search pane is open and the text I look for is highlighted. How can I trigger the Search button so that all occurrences are listed below in the search pane?
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Do Search from the code

Post by Corwin - Tracker Sup »

Sorry, but ActiveX does not allow you to do this..
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Do Search from the code

Post by Rad1 »

is it now possible to search from the code on the new builds ???
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Do Search from the code

Post by Corwin - Tracker Sup »

For now there are no methods to control search panel. But you can use usual search via code.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Do Search from the code

Post by Rad1 »

Corwin - Tracker Sup wrote:For now there are no methods to control search panel. But you can use usual search via code.
Hi Corwin,

How can I do ?

Thanks.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Do Search from the code

Post by Corwin - Tracker Sup »

In JS for web you can use next code:

Code: Select all

var objArray = new ActiveXObject("PDFXCviewAx.CoPDFXCargs");
objArray.add(57636);
objArray.add("Text to find");

PDFView.DoVerb("", "ExecuteCommand", objArray.Data, 0, 0);
HTH
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Do Search from the code

Post by Rad1 »

Hi,

Thanks for reply. But it don't work. I tried to run it using RunJavaScript function and directly using browser internet explorer !

I obain an error like "Element not found" at this line "objArray.add(57636);"
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Do Search from the code

Post by Rad1 »

It works well. Thank you. I just want to know how can I dispaly serach pannel with links. Like "manual search" ?

Is it possible to send me more inforamtion about parameters to pass to objArray ? I look for parametre to display the pannel with search results (like when we click on "Search Now" button).

Thank you for help.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Do Search from the code

Post by Corwin - Tracker Sup »

Next code will show search panel:

Code: Select all

PDFView.SetProperty('View.Panes["Search"].Visible', 1, 0);
But for now we don’t have any methods to control search using this panel via code.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Do Search from the code

Post by Rad1 »

Hi Corwin,

It's exactly what I do to display search panel. But the problem is how to click on the "Search now" button to display result in the search panel.

Thanks.
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Do Search from the code

Post by Corwin - Tracker Sup »

Corwin - Tracker Sup wrote:Sorry, but ActiveX does not allow you to do this..
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Do Search from the code

Post by Vasyl - PDF-XChange »

This feature will be added in the near future.
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.
Rad1
User
Posts: 108
Joined: Wed May 13, 2009 2:21 pm

Re: Do Search from the code

Post by Rad1 »

Hi,

I knew it :D , thank you for your reactivity.
User avatar
John - Tracker Supp
Site Admin
Posts: 5223
Joined: Tue Jun 29, 2004 10:34 am

Re: Do Search from the code

Post by John - Tracker Supp »

;)
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