2

I have an ASP.NET C# application using MVC. I need to open a PDF file at a specific page in an iframe. I will have to search for a text inside the PDF and open the PDF at the page where the text occurs. How do I do this?

I have tried iTextSharp. But was not able to implement it. Can anyone help me in this regard?

Also tried using Acrobat and AFORMAUTLib, but was not able to.

2
  • How are you opening the PDF - in an Acrobat view? So you just want to specify the start point to display when opening an Acrobat view? Or are you rendering the PDF to an image on the server and displaying that, or something else? Commented May 23, 2011 at 13:34
  • Am using the acrobat view only. I tried mentioning "#page=2", but that did not work for my iframe. Am displaying the pdf directly. Commented May 23, 2011 at 13:57

2 Answers 2

3

Adobe Reader allows "URL Parameters":

Here's the Adobe documentation

And here's the option for searching a document: search=wordList Opens the Search UI and performs a search for the specified word list in the document. Matching words are highlighted in the document. The words must be enclosed in quotes and separated by spaces; for example:

#search=”word1 word2”
Sign up to request clarification or add additional context in comments.

2 Comments

This worked like a charm. Similarly is there any option to search words in MS word, excel and text files?
I am not aware of any options like this for MS Word or Excel, I thinks it's only supported by Adobe Reader.
0

The other answers are correct with respect to searching the document. For display, the mime type alone should be sufficient for most web browsers to display it. Try making the src of your iframe the virtual path to the pdf.

If you need to actually create the PDF, I have done this with iTextSharp--which you mentioned. I could show you how to do it if you'd like. To do so, I need to know what you are trying to do.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.