how to search and highlight pdf's keyword programmatically - c#

i've tried two different component to integrate pdf file in windows form application (c#).
the above mentionated component are PDFSharp and Sloppycode webBrowserEx.
Now, both of them work fine, but I'm not able to search and highlight programmatically full text defining by user through a textBox.
Can anyone give me some suggest to achieve my purpose?
Thanks in advance.

I found this answer to help me when I was working with PDFs. Not sure if you seen it yet but it may help you. I went with iTextSharp.
how to highlight a text or word in a pdf file using iTextsharp?
hope it helps.

Related

Output all hyperlinks in a pdf with C#

a good friend of mine is currently writing a book for his PhD, and asked me if I could help him automate the process of checking all his given sources (hyperlinks). I've searched all over the internet and could not find any helpful tip on how to help him though. I've came across iText7 and iTextSharp, but could not manage to make them work.
For the beginning it would already be a huge help, if I could just look out for the links (by parsing the whole pdf into a string, and search for the //.../ tags?), and show them in a listbox.
I was not able to find any link using the iTextSharp ANNOT function, so I guess the pdf he gave me is not correctly formatted.. I should still be able to parse the text and search for links (RegEx), right?
Does anyone have a hint for me, on how I could make this work? Thanks in advance!

Opening Word (.docx) files on a Windows Form C#

I'm trying to make my program have the ability to display a Microsoft Word file on a form but not having any luck in doing so. I want to be able to open the file and display it on the form as a Read-Only. So basically just display it's contents. Various users on the web have recommended displaying files in the WebBrowser control (under toolbox). I have tried this but failed to get it working. My end goal is to be able to annotate on top of the web browser (or something of similar manner) and subsequently save the annotations along with the opened file.
I'm not that experienced in the C# language too so any help on how to achieve my problem would be greatly appreciated.
You need a DOCX viewer control. My company recently gave away our multi-format WinForms viewer control as a free product - XtremeDocumentStudio .NET Free. It can display DOCX and is available on NuGet. It does not require a Web Browser control for embedding an online viewer or Word software installed locally.
http://www.nuget.org/packages/XtremeDocumentStudio.NETFree/
There are some good links that might help you.
First, you will find a closely related or similar question here
And in that conversation someone posted the following link which is about how to build a user control for displaying Word documents in a webbrowser control.
I also found another article here about how to integrate Excel in a Windows Form application using WebBrowser. But Excel is used as an example and you may be able to adapt it to Word.

Creating an HTML document out of RichTextBox in WPF

I am having issues creating an html document out of a RichTextBox. I am able to get all of the text out of the RichTextBox. This issue is when I go to get images that I pasted in by using Windows Snipping tool don't show up in the document. Is there a way to do this?
Perhaps you could give us a non-working example where the error occurs in order to help you. Anyway, you could also check this and this out.
Hope I helped!

How to edit PDF File with iTextSharp

I'm currently working on a .NET Desktop Application project, I need to manipulate a PDF template by replacing some keywords. It would be great if I can see a simple sample. Thanks in advance.
iTextSharp only allows you to modify Form Fields not flattened text.

.NET - Problem with printing

Presently I am having a problem with printing in C#.
I have a pre-printed bill, and I need to print values into some
specific points of that bill.
Any suggestions?
If I understood your need correctly, you can create a PDF file using iTextSharp with the proper values in the specific locations you need, and then print it on your pre-print bill.
You can also try using the XPS documents, there are some good controls to help you accomplish this task.
If your going the iTextSharp way, the SetAbsolutePosition function is your friend. See the documentation on how to absolute positioning of elements in the PDF file.
Have you considered a standard reporting tool, this will have a visual interface to help lay things out?

Categories