[javascript FR] javascript interaction with Search

Please post any ideas or requests for new features here for the End User Version of PDF-XChange (printer Drivers)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators

Mathew
User
Posts: 762
Joined: Thu Jun 19, 2014 7:30 pm

[javascript FR] javascript interaction with Search

Post by Mathew »

At the simplest, if javascript could send a list of file paths to the search pane, that would make it really useful for searching collections of files. Currently, you can manually pick folders, but I want to be able to suggest a list of files (not necessarily all files in a folder, and they may be in different folders) to search.

The second more complicated part of this request is that I'm thinking of this as part of a tool that has centralized files that are synchronized with local versions. The search should happen against all the central files, but the files that people interact with would be local files; so search results linking to the central files would cause problems. I'm looking for a way for the script to be able to give an equivalent local file/filename to the search (the local file may not even be open, or even downloaded yet though.) This could be by registering a callback to the search when the folders are sent to the search maybe, or maybe the links from this search activate a callback? The callback could then load the correct file, and go to the relevant location (or allow search to highlight/show it).

I think it would be possible to do these searches directly within javascript (by creating index files). But I think this would be unwieldy and slow; and the built-in search is already excellent.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 12501
Joined: Wed Jan 03, 2018 6:52 pm

Re: [javascript FR] javascript interaction with Search

Post by Daniel - PDF-XChange »

Hello, Mathew

Thank you for the suggestions, I have passed them up the chain for review!

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2476
Joined: Thu Jun 30, 2005 4:11 pm

Re: [javascript FR] javascript interaction with Search

Post by Vasyl - PDF-XChange »

Hi Mathew.
At the simplest, if javascript could send a list of file paths to the search pane, that would make it really useful for searching collections of files. Currently, you can manually pick folders, but I want to be able to suggest a list of files (not necessarily all files in a folder, and they may be in different folders) to search.
Just an idea which can be implemented, potentially:

Code: Select all

var listToSearchIn =

"/c/dir1/test11.pdf\n" +
"/c/dir1/test21.pdf\n" +
...
"/c/dir2/test21.pdf\n" +
...
"/d/dir3/";

search.query("<search_citeria>", "list", listToSearchIn);
// - it will show the Search pane and start search in specified files/folders...
This could be by registering a callback to the search when the folders are sent to the search maybe, or maybe the links from this search activate a callback? The callback could then load the correct file, and go to the relevant location (or allow search to highlight/show it).
You're right — it can be quite difficult, especially due to the difficulties and limitations in the interaction process between JS and the native runtimes.
At the moment, I'm not sure if it is even possible to implement an effective solution for it there.

Cheers.
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.
Mathew
User
Posts: 762
Joined: Thu Jun 19, 2014 7:30 pm

Re: [javascript FR] javascript interaction with Search

Post by Mathew »

Thank you Vasyl -- I didn't realize I could make a newline delimited list. That's great.

I spent a bit of time looking at adobe's catalog and index objects: Could PXCE use a form of index for searches that could be pre-generated and saved? For the kind of use scenario I'm thinking, especially if files are large, just accessing all the files and then searching them each time could be time consuming