

If the response is helpful, please click " Accept Answer" and upvote it. Result = page.FindText(word.Key, TextFindParameter.WholeWord).Finds įind.ApplyRecoverString(word.Value,, true) Public static void FindTextInPDFAndReplaceIt(PdfDocument documents, Dictionary dictionary)įoreach (PdfPageBase page in documents.Pages) PdfDocument doc = new dictionary = new Dictionary() įindTextInPDFAndReplaceIt(doc, FileFormat.PDF)

We cannot directly edit the text in the file, but they provide a way to replace: static void Main(string args) I sometimes use FreeSpire.PDF, it is easy to use and provides a wealth of code examples, but the free version can only be used for pdf files with a small number of pages (less than 10). This is very comfortable, so developer don't waste time for this. I hope, this is what you were looking for.Īlso, this library automatically creates new page when current page is finished, so the content is continuing at the next page. AddParagraph("This is another page inserted")Īs you can see, there is a method InsertNewPage() which can be called at any moment. AddParagraph("Hello World!").SetFontColor(Color.Red) Your first PDF you can create with just a few lines of code: var section = DocumentBuilder.New().AddSection()

There are also how-to-build articles for each sample, which definitely might help you get going. It supports repeating headers, automatic page numeration, multi-page spread tables and many other layouting options.Īlso, many samples of business documents built using this library are located in a repo ( ), I haven't seen that much from other PDF generating libraries. You basically create PDF documents from scratch with it. I would recommend a free PDF developer's library for C# PDFFlow for your needs.
