using SautinSoft.Pdf;
class Program
{
static void Main(string[] args)
{
// Load your PDF document
PdfDocument pdf = new PdfDocument();
pdf.Load(@"document.pdf");
// Find and replace text
string searchText = "old text";
string replaceText = "new text";
pdf.ReplaceText(searchText, replaceText);
// Save the modified PDF
pdf.Save(@"modified_document.pdf");
}
}
The PDF .Net product includes a code example for finding and replacing text in a PDF document. This example demonstrates how to use the library to programmatically locate and replace specific text within a PDF file.
The product supports various platforms, including Windows, Linux, macOS, and Docker, and is compatible with .NET 8, 7, 6, 5, Standard 2, Core 2x & 3x, and Framework 4.6.2+.