TX Text Control .NET allows developers to create PDF files programmatically using C# in various ways including creating documents from scratch, merging data into pre-defined templates and by converting documents such as HTML to PDF.
Requirements
In order to create the project in this tutorial, it is required to install TX Text Control .NET Server for ASP.NET. Download a trial version here:
This article doesn't show how to create new projects using TX Text Control, but how to create the documents itself. To learn how to create a new project using TX Text Control, please have a look at this tutorial:
Create or Generate Adobe PDF files in ASP.NET Core with C#
Creating PDFs from Scratch
TX Text Control can be used to create all supported document types with the same streamlined API ╰ TX Text Control .NET Server for ASP.NET
╰ TXTextControl Namespace
TXTextControl Namespace . After creating a new instance of Server ╰ TX Text Control .NET Server for ASP.NET
╰ TXTextControl Namespace
╰ ServerTextControl Class
The ServerTextControl class implements a component that provide high-level text processing features for server-based applications. , content such as text, tables and images can be added programmatically. The following code shows how to create a new instance of ServerTextControl in order to insert text and a table. At the end, the document is exported as an Adobe PDF document.

Creating PDFs from MS Word Templates
Another method to create PDF documents is to use MS Word templates such as Office Open XML (*.docx) files in order to merge data into merge fields. The following simple template is used for the merge process using the Mail ╰ TX Text Control .NET Server for ASP.NET
╰ DocumentServer Namespace
╰ MailMerge Class
The MailMerge class is a .NET component that can be used to effortlessly merge template documents with database content in .NET projects, such as ASP.NET web applications, web services or Windows services. class.
The following JSON data is used as a simplified data source. TX Text Control supports complex hierarchical data with nested merge block structures.

The following C# code is merging JSON data into MS Word compatible merge fields in order to create the resulting PDF document.

Learn More
TX Text Control's MailMerge engine allows you to perform MS Word compatible mail merge processes in .NET based applications. This article gives an overview of the basic functionality and shows how to merge JSON data into templates.
Converting Documents
Another way to create PDF documents is to convert them from other formats such as HTML. Using TX Text Control, you can load the content and create the Adobe PDF document by saving the content.
The following code shows how to load an HTML string into a new instance of ServerTextControl in order to export the document as an Adobe PDF file.

Extended PDF Functionality
TX Text Control provides many extended PDF functionalities and can be used to create electronic invoices and digitally signed documents.
TX Text Control can be efficiently used to create Adobe PDF documents with digital signatures. These signatures can be created with PFX, DER Cer or Base64 CER certificate files. All you need is a valid certificate that is defined in the Save ╰ TX Text Control .NET Server for ASP.NET
╰ TXTextControl Namespace
╰ SaveSettings Class
The SaveSettings class provides properties for advanced settings and information during save operations. class.

Learn More
TX Text Control can be used to create PDF forms, PDF files with embedded attachments or to digitally sign documents. Learn more about these feature in these articles:
Creating Adobe PDF Forms in C#
Creating ZUGFeRD Compliant PDF Invoices in C#
Adding Electronic and Digital Signatures to Documents in C# and Angular