Skip to main content
kiran66042421
Participant
August 31, 2016
Question

How to create search button for interactive PDF without popup search pane

  • August 31, 2016
  • 1 reply
  • 1133 views

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!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 31, 2016

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