简体   繁体   中英

How to display a pdf file in browser by passing a search string and need to display that page 1st with contains highlighted search string using java

I already done with displaying a pdf file in browser and i am passing a search string, but it parsing the string into words and then searching in the pdf file .I want whole string search in pdf file directly when i pass the search string

In java ,i done a project tool for pdf search engine where i used the lucene 3.x and pdfbox0.7 works similar google search engine ...

1) Enter the search string in the text box

2) When click on search it will search in the pdf files and display the matched result as a fragment of some text from file ,displays in the result with highlighted words in the result

3) Now when user clicks on the results found it should open the pdf file and the search string must be highlighted in the pdf file...

< object data=".<%=filename%>#search=<%=key1%>&view=FitBH,top&toolbar=0" type="application/pdf" width="1350" height="650"> alt : < a href=".<%=filename%>">test.pdf< /a> < /object>

it is displaying the pdf file in browser with highlighted words of a search string but i need the whole string need to be highlighted...

PLease help me

About the part of displaying a pdf directly in the browser: How do you do it? Not everybody has a pdf-plugin in his browser, so the browser would offer to download the pdf as a file. When this happens you can't highlight text in the pdf. Or do you use a library for that?

For displaying PDFs in the browser, you might have a look at pdf.js . Maybe it even supports highlighting a given search string (ie triggering the search inside pdf.js).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM