Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Aug 30, 2016 Aug 30, 2016

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:

ctrl-F.jpg

I've tried using the below javascripts, but when I click on the buttons, a pane listing search results pops up.

See below:

search-pane.jpg

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!

TOPICS
Acrobat SDK and JavaScript , Windows
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2016 Aug 31, 2016
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines