tags:

views:

100

answers:

3

Dear all;

I'm afraid I don't even know where to start with the following problem, so if any of you would give me some pointers, I'd appreciate it.

I need to load and display a pdf file. Then I need to search and colorize a few words of interest in said pdf file (noting position, page, etc) using C#. I have Adobe Acrobat 7 professional, so I have some of the COM tools.

Regards.

+1  A: 

You can use iText to load, modify and re-save the document. If you can get on by just launching Acrobat afterwards, you're home.

danbystrom
but i can't search for text, can I?
Dervin Thunk
oh yes. you can break up the pdf in all its pieces and manipulate them at your wish.
danbystrom
+1  A: 

Manipulating a PDF file is hard since pdf is a hard format. There are good libraries does great job such as ITextSharp.

But my advise is convert the pdf file to html and play with the html output. Then display it on a WebBrowser control.

I know this is an ugly solution. Also this ugly solution has another ugly solution for converting a pdf file to html.

See: http://aspdotnetcodebook.blogspot.com/2008/08/how-to-convert-pdf-file-to-text-in.html

JCasso
A: 

My company sells .NET PDF components that can be used to extract text from documents as well as display pages. We have a demo here which does full text search and highlighting of a PDF document, which is very close to what you want to do. As long as the changes don't need to be permanent, this technique will work for you.

plinth