简体   繁体   中英

How to highlight text in Pdf Winforms C#

I have a pdf file which I want to open in a Windows Forms Application and perform following tasks-

  1. View the pdf document
  2. Zoom +/- document
  3. Search Text
  4. Highlight a specific text
  5. Show it in a listbox/dropdown
  6. select those words and highlight in pdf
  7. Remove selection/Highlight.

I have tried using certain libraries like pdfSharp/iTextSharp even Acrobat Reader OCX control.

Its really bugging me..is there any help??

I'd suggest looking at some means of converting the PDF if you don't have a direct need to edit it. Even then, it may be easier to convert to a different form, make changes, and then convert back. PDF is a form of PostScript, which makes it powerful, but also makes it a mess to deal with and my personal preference is to skip that headache. Not always avoidable (had a lot of fun creating Thai support in PDF print@home ticket creation once without bloating the document beyond unusable), but highly recommended where possible.

Anyways, there are a variety of PDF conversion libraries out there, some of which may be available for .NET. Worst case, you may need to create a managed C++ layer to allow your C# code to access them.

Doesn't acrobat reader OCX already have all those features ? What exactly doesnt the OCX do that you need to do in your code ?

You might try contacting Adobe and getting their full SDK for PDF. It might have controls which you can use to solve your problem.

Come to think of it , is there even an SDK for PDF from Adobe ?

You have not mentioned your preference of using Free or Commercial PDF Viewer option. If you are open to use Commercial PSF viewer, you may evaluate SyncFusion PDF Viewer control , Telerik PDF Viewer , Dynamic PDF Viewer or TallComponents . I have checked feature set and all seem to have features you are looking for. I do not represent or promote any of these SDKs, I have used TallComponents and Dynamic PDF for PDF manipulation and both have excellent support, I would say PDF Veterans in .NET space.

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