# PDF Examples

> PDF demos and samples: creating PDF from code and HTML, ZUGFeRD invoices, fillable forms, form data, XFDF, watermarks, encryption, text extraction and PDF/UA.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Examples > PDF Examples
- **1990 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/pdf/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/pdf/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/pdf/llms-full.txt

---

From a first PDF built in code to an electronic invoice with embedded XML, the PDF examples follow the tasks of PDF processing: creating documents from code and HTML, creating and reading forms, protecting documents and checking them for accessibility. The online demos run each task on the current version; the sample projects are applications and classes that you can take further.

### Online Demos

| Example | What it shows | Where |
|---|---|---|
| PDF from code | A PDF document built from scratch with `ServerTextControl` | [Create PDFs Programmatically](https://demos.textcontrol.com/demos/pdf/creating-pdfs/programmatically) |
| PDF from HTML | HTML markup converted into a paginated PDF document | [Create PDFs from HTML](https://demos.textcontrol.com/demos/pdf/creating-pdfs/from-html) |
| ZUGFeRD invoice | A PDF/A invoice with the invoice data embedded as XML | [Create a ZUGFeRD Invoice](https://demos.textcontrol.com/demos/pdf/creating-pdfs/zugferd-invoice) |
| Document properties | Title, author, subject and keywords added to the PDF | [Set PDF Document Properties](https://demos.textcontrol.com/demos/pdf/creating-pdfs/document-settings) |
| Fillable forms | A form template filled with data and saved as an interactive or a flattened PDF | [Create Fillable PDF Forms](https://demos.textcontrol.com/demos/pdf/forms-processing/forms-creation) |
| Merging form fields | Form fields preselected with data or replaced by the merged text | [Merge PDF Form Fields](https://demos.textcontrol.com/demos/pdf/forms-processing/form-field-mail-merge) |
| Form data | The values of completed AcroForm fields read on the server | [Extract PDF Form Data](https://demos.textcontrol.com/demos/pdf/forms-processing/form-data-extraction) |
| Encryption | A PDF protected with passwords and access permissions | [Encrypt PDF Documents](https://demos.textcontrol.com/demos/pdf/security/encryption) |

[CSV to PDF](https://demos.textcontrol.com/demos/server-side-processing/csv-to-pdf) is listed in [Document Processing Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/document-processing/llms-full.txt), the PDF.js demos of the viewer in [Document Viewer Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/document-viewer/llms-full.txt) and the signing demo in [Digital Signature Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/digital-signatures/llms-full.txt).

### Sample Projects

| Example | What it shows | Where |
|---|---|---|
| Fillable PDF from an HTML form | The form fields of a template turned into an HTML form, and the submitted values merged into the template and saved as PDF, as described in [Create Fillable PDFs from HTML Forms in C# ASP.NET Core Using a WYSIWYG Template](https://www.textcontrol.com/blog/2026/03/17/create-fillable-pdfs-from-html-forms-in-csharp-aspnet-core-using-a-wysiwyg-template/). .NET 10, version 34.0 | [TXTextControl.FormsToPDF](https://github.com/TextControl/TXTextControl.FormsToPDF) |
| Watermarks per download | A watermark with data of the user added at each download, and the PDF signed so that its removal is detectable, as described in [Secure by Design: Dynamic Watermarking for Enterprise Documents in C# .NET](https://www.textcontrol.com/blog/2026/02/06/secure-by-design-dynamic-watermarking-for-enterprise-documents-in-csharp-dotnet/). .NET 10, version 34.0 | [TXTextControl.TXEnterpriseWatermark](https://github.com/TextControl/TXTextControl.TXEnterpriseWatermark) |
| Extracted text in PDF.js | The text lines of a PDF extracted on the server and shown as overlays in a PDF.js viewer, as described in [Visualizing Extracted PDF Content in a PDF.js Viewer Using TX Text Control in C# ASP.NET Core](https://www.textcontrol.com/blog/2025/11/27/visualizing-extracted-pdf-content-in-a-pdfjs-viewer-using-tx-text-control-in-csharp-aspnet-core/). Version 34.0 | [TXTextControl.PDF.PDFJS](https://github.com/TextControl/TXTextControl.PDF.PDFJS) |
| XFDF | A class that exports the AcroForm fields of a PDF as XFDF and preselects form fields from XFDF, as described in [Export and Import Adobe PDF XFDF XML Files in .NET C#](https://www.textcontrol.com/blog/2025/01/22/export-and-import-adobe-pdf-xfdf-xml-files-in-net-c-sharp/). The repository contains the class only | [XfdfProcessing](https://github.com/TextControl/XfdfProcessing) |
| HTML forms from PDF forms | The AcroForm fields of a PDF turned into HTML form elements, as described in [Auto-Generate HTML Forms from PDF AcroForms in C#](https://www.textcontrol.com/blog/2023/03/06/autogenerate-html-forms-from-pdf-acroforms-in-csharp/). Version 33.0 with the Classic engine | [TextControl.Web.MVC.Core.PDFForms](https://github.com/TextControl/TextControl.Web.MVC.Core.PDFForms) |

### Electronic Invoice Samples

The samples below work with invoices in the ZUGFeRD, Factur-X and XRechnung formats: a PDF/A-3 document with the invoice data embedded as XML. They were written for earlier versions of TX Text Control and of the ZUGFeRD standard:

| Example | What it shows | Where |
|---|---|---|
| ZUGFeRD 2.3 | An XRechnung invoice in the ZUGFeRD 2.3 format embedded in a PDF/A-3 document, as described in [Creating ZUGFeRD 2.3 (XRechnung, Factur-X) Documents with .NET C#](https://www.textcontrol.com/blog/2025/01/02/creating-zugferd-2-3-xrechnung-factur-x-documents-with-net-c-sharp/). Version 32.0 with the Classic engine | [TXTextControl.ZUGFeRD23](https://github.com/TextControl/TXTextControl.ZUGFeRD23) |
| Readable view of e-invoices | XRechnung, ZUGFeRD and Factur-X data shown as a readable document, as described in [Visualize and Preview XRechnung, ZUGFeRD, and Factur-X Documents in .NET C#](https://www.textcontrol.com/blog/2025/01/02/visualize-and-preview-xrechnung-zugferd-and-factur-x-documents-in-net-csharp/). Version 32.0 with the Classic engine | [TXTextControl.XRechnung.Visualize](https://github.com/TextControl/TXTextControl.XRechnung.Visualize) |
| Invoices from a merge | XRechnung and ZUGFeRD invoices whose XML comes from the open-source ZUGFeRD-csharp library and whose readable part is created with `MailMerge`, as described in [Creating Valid XRechnung / ZUGFeRD Invoices with ASP.NET Core C#](https://www.textcontrol.com/blog/2023/12/28/creating-valid-xrechnung-zugferd-invoices-with-asp-net-core-csharp/). Version 33.0 with the Classic engine | [TXTextControl.InvoiceGenerator](https://github.com/TextControl/TXTextControl.InvoiceGenerator) |

[Electronic Invoices](https://docs.textcontrol.com/tx-text-control-dotnet-server/pdf/pdf-a/#electronic-invoices) in PDF/A and [Attachments](https://docs.textcontrol.com/tx-text-control-dotnet-server/pdf/attachments/llms-full.txt) describe the current code.

### Blog Articles With Code

| Example | What it shows | Where |
|---|---|---|
| PDF/UA validation | PDF documents checked for PDF/UA with `TXTextControl.PDF.Validation`, with JSON reports | [Validating PDF/UA Documents in .NET C#: A Practical Guide](https://www.textcontrol.com/blog/2026/07/06/validating-pdf-ua-documents-in-dotnet-csharp/) |
| PDF/UA preflight | A document checked for the requirements of PDF/UA before it's saved | [Preflighting PDF/UA Documents with TX Text Control in .NET C#](https://www.textcontrol.com/blog/2025/12/29/preflighting-pdf-ua-documents-with-tx-text-control-dotnet-csharp/) |
| PDF/A for archiving | Office documents converted to PDF/A in a .NET console application on Linux | [From DOCX to Long-Term Archiving: Generating PDF/A from Office Documents in .NET C#](https://www.textcontrol.com/blog/2025/09/04/from-docx-to-long-term-archiving-generating-pdfa-from-office-documents-in-dotnet-csharp/) |
| PDF on Linux | PDF and PDF/A documents created in .NET on Linux | [How to Create PDF Documents with TX Text Control using C# .NET on Linux](https://www.textcontrol.com/blog/2025/03/18/how-to-create-pdf-documents-with-tx-text-control-using-c-sharp-net-on-linux/) |
| Forms from DOCX templates | DOCX form templates filled, flattened and exported to PDF | [Programmatically Fill, Flatten, and Export DOCX Form Templates to PDF in C# .NET](https://www.textcontrol.com/blog/2026/04/10/programmatically-fill-flatten-and-export-docx-form-templates-to-pdf-in-csharp-dotnet/) |
| Form fields | PDF form fields created, preselected, flattened and extracted | [Create, Pre-Select, Flatten and Extract PDF Form Fields using C#](https://www.textcontrol.com/blog/2023/08/14/create-preselect-flatten-and-extract-pdf-form-fields-using-csharp/) |
| Encryption and permissions | Passwords and access permissions of PDF documents | [PDF Security for C# Developers: Encryption and Permissions in .NET](https://www.textcontrol.com/blog/2025/06/16/pdf-security-for-csharp-developers-encryption-and-permissions-in-dotnet/) |
| Watermarks | An SVG watermark added to every page through a header | [Adding Watermarks to PDF Documents in .NET C#](https://www.textcontrol.com/blog/2025/02/06/adding-watermarks-to-pdf-documents-in-net-c-sharp/) |
| Keywords | Keywords written to and read from PDF documents for search | [Enhancing PDF Searchability in Large Repositories by Adding and Reading Keywords Using C# .NET](https://www.textcontrol.com/blog/2025/06/24/enhancing-pdf-searchability-in-large-repositories-by-adding-and-reading-keywords-using-csharp-dotnet/) |

### Next Steps

- [PDF Processing](https://docs.textcontrol.com/tx-text-control-dotnet-server/pdf/llms-full.txt): PDF creation, PDF/A, PDF/UA, forms and attachments in detail.
- [Digital Signature Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/digital-signatures/llms-full.txt): sign the PDF documents you create.
- [PDF Processing](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/pdf/llms-full.txt) in Getting Started: create a first PDF step by step.

---

## Nearby

- **Previous:** [Mail Merge Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/mail-merge/llms-full.txt)
- **Next:** [Digital Signature Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/examples/digital-signatures/llms-full.txt)
