How to search in PDF format in Acrobat Reader And go to a specific page through the parameter?

We use lucene in a web application to search a large number of PDF documents.

The workflow is as follows:

  • User enters search query

  • A list of search results is provided to the user.

  • Each search result is a single PDF document and shows the user on which page the search query was found. Each of these pages is represented as a hyperlink.

  • If the user now clicks on such a hyperlink, he directly goes to this page.

  • But now the user has a problem that the search query does not stand out on the page. Therefore, the user must search independently to find the search query on the page.

What we wanted is a way to highlight the search term on a specific page in PDF.

The open options for Acrobat Reader allow you to either search for a PDF document (with highlight) or go to a specific page. But the combination of both parameters that we need does not work.

Does anyone have any ideas on how to navigate to a page and highlight the search term in a PDF document? I looked at the Acrobat SDK, but I don’t see how we can use it (this is terribly documented).

+5
source share
3 answers

acrobat uses a plugin for hilite terms and requires a fdf stream to indicate words in hilite. See here for pointers:

support.dtsearch.com/dts0152.htm

:

, # # hilight, :

-:

<iframe id="acroframe" src="pdfpage/example.pdf#xml=http://example.com/hilite.aspx?hilite=8e3302ee-ff88-41ee-bdfb-9e8df87cc3ad&toolbar=1&navpanes=0&statusbar=0&view=FitH">
</iframe>

PDF , , . -, xfdf hilighting: http://example.com/hilite.aspx?hilite=8e3302ee-ff88-41ee-bdfb-9e8df87cc3ad

, hilite xfdf. hilite.aspx - :

<XML>
<Body units=characters color=#ff00ff mode=active version=2>
<Highlight>
<loc pg=15 pos=3583 len=5>
</Highlight>
</Body>
</XML>

hilight 5 . 15, 3583. (: xfdf "XML", )

, " " .

+2

, , , PDF html Lucene ( , Google).

0

You need to write a Javascript snippet to get the behavior you are looking for.

0
source

All Articles