Add Text to PDF in C#

PDF format is widely used to generate various types of documents such as invoices, financial reports, resumes, etc. In the world of automation, PDF documents are generated and manipulated from within the web or desktop applications. Thereby, in certain cases, you may need to add text to the existing PDF files programmatically. Following that, this article shows how to add text to PDF files in C#.

C# PDF Text Manipulation Library

To add text to PDF files dynamically, we will use Aspose.PDF for .NET. It is a feature-rich library that lets you create and manipulate PDF files from within your .NET applications. You can either download the library or install it using NuGet.

PM> Install-Package Aspose.PDF

C# Adding Text to a PDF

The following are the steps to add text to a PDF file in C#.

C# PDF Text Insertion Code

The following code sample shows how to insert text to a PDF file in C#.

C# Insert Text to PDF using TextParagraph

The following are the steps to add text to a PDF file using TextParagraph.

The following C# code sample shows text insertion in a PDF using TextParagraph class.

Insert Transparent Text in PDF in C#

Aspose.PDF for .NET also allows adding transparent text to a PDF document, as demonstrated in the following steps.

The following code sample shows how to add transparent text to a PDF in C#.

Free PDF Text Insertion Library

You can get a free temporary license for text insertion in PDF files without any limitations.

C# PDF Library

You can explore more about the C# PDF library using the documentation. Also, you can post your queries on our forum.

Conclusion

In this article, you have learned how to add text to existing PDF files using C#. In addition, you have seen how to add transparent text to a PDF dynamically. You can easily install the library and use the provided methods of text insertion in PDF files.

See Also