Copy link to clipboard
Copied
I am creating an interactive PDF using Acrobat DC.
The PDF needs to include a "search" button that users can click on, that has the same function of typing Ctrl + F (to bring up the search function in Adobe Reader).
This search window should appear:
I've tried using the below javascripts, but when I click on the buttons, a pane listing search results pops up.
See below:
JAVASCRIPT 1:
var textToSearch = this.getField("Search").valueAsString;
if (textToSearch!="") search.query(textToSearch, "ActiveDoc");
JAVASCRIPT 2:
var textToSearch = app.response("Enter the search term:");
if (textToSearch!="") search.query(textToSearch, "ActiveDoc");
Is there any way of creating a button that only brings up the search window (top image) but not the panel of search results?
Many thanks!
Copy link to clipboard
Copied
You can open the Find window using this JS code, but you can populate it with a search term or run it... The code is:
app.execMenuItem("Find");
Find more inspiration, events, and resources on the new Adobe Community
Explore Now