# Validate PDF/UA Documents and Verify Electronic Signatures in C# .NET

> The new TXTextControl.PDF.Validation NuGet package enables you to validate PDF/UA documents and verify digital signatures directly in your code without relying on third-party tools or external services.

- **Author:** Bjoern Meyer
- **Published:** 2025-11-13
- **Modified:** 2026-07-17
- **Description:** The new TXTextControl.PDF.Validation NuGet package enables you to validate PDF/UA documents and verify digital signatures directly in your code without relying on third-party tools or external services.
- **7 min read** (1376 words)
- **Tags:**
  - ASP.NET Core
  - ASP.NET
  - PDF
  - PDF/UA
  - Validation
- **Web URL:** https://www.textcontrol.com/blog/2025/11/13/validate-pdf-ua-documents-and-verify-electronic-signatures-in-csharp-dotnet/
- **LLMs URL:** https://www.textcontrol.com/blog/2025/11/13/validate-pdf-ua-documents-and-verify-electronic-signatures-in-csharp-dotnet/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2025/11/13/validate-pdf-ua-documents-and-verify-electronic-signatures-in-csharp-dotnet/llms-full.txt

---

We released a beta version of [TXTextControl.PDF.Validation](https://www.nuget.org/packages/TXTextControl.PDF.Validation), a new .NET library that validates TX Text Control-generated PDF documents. With this package, developers can validate PDF/UA (Universal Accessibility) compliance and verify digital signatures programmatically within their .NET applications.

### Why Validation Matters

TX Text Control automatically creates PDF/UA-compliant documents when accessibility features, such as tagged structures, reading order, and descriptive text, are used. However, achieving full compliance depends on the completeness of the content.

For example, when exporting a document containing several images, you may only provide alt texts for some of them. While the resulting file will be a valid, technically structured PDF/UA document, it will not be fully compliant with the PDF/UA standard since not all images include alt text.

In such cases, validation is critical. One option is to use the API to check that all elements have descriptive texts and all required metadata before exporting the document. However, it is easier and safer to check the generated document afterwards.

TXTextControl.PDF.Validation analyzes the generated PDF and reports exactly where compliance gaps exist, such as missing alternative text, incorrect structural elements, or missing metadata. This ensures that every exported PDF meets the ISO 14289 (PDF/UA) requirements for accessible and inclusive digital documents.

### Validating PDF/UA Documents

It's simple to integrate validation into your workflow. The following example shows how to validate a PDF file and list all the issues that were detected.

#### Creating the Application

First, create a new .NET console application and install the `TXTextControl.PDF.Validation` NuGet package.

Make sure that you downloaded the latest version of Visual Studio 2022 that comes with the [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0).

1. In Visual Studio 2022, create a new project by choosing *Create a new project*.
2. Select *Console App* as the project template and confirm with *Next*.
3. Enter a project name and choose a location to save the project. Confirm with *Next*.
4. Choose *.NET 8.0 (Long Term Support)* as the *Framework*.
    
    ![Creating the .NET 8 project](https://s1-www.textcontrol.com/assets/dist/blog/2025/11/13/a/assets/visualstudio1.webp "Creating the .NET 8 project")

#### Adding the NuGet Packages

5. In the *Solution Explorer*, select your created project and choose *Manage NuGet Packages...* from the *Project* main menu. Select **nuget.org** as the *Package source* Enable the *Include prerelease* checkbox.
    
    Install the following package:
    
    
    - **TXTextControl.PDF.Validation**
    
    ![ASP.NET Core Web Application](https://s1-www.textcontrol.com/assets/dist/blog/2025/11/13/a/assets/visualstudio2.webp "ASP.NET Core Web Application")

#### Validating a PDF Document

6. Find the *Program.cs* file in the *Solution Explorer* and replace the code with the following code snippet:
    
    ```
    using System;
    using System.IO;
    using System.Linq;
    using TXTextControl.PDF.Validation;
    
    const string DefaultFileName = "documents/result.pdf"; // adjust path if needed
    
    // flags can be anywhere
    bool asJson = args.Any(a => a.Equals("--json", StringComparison.OrdinalIgnoreCase));
    // first non-flag is the filename
    string? fileArg = args.FirstOrDefault(a => !a.StartsWith("--", StringComparison.Ordinal));
    
    string file = fileArg ?? Path.Combine(AppContext.BaseDirectory, DefaultFileName);
    
    if (!File.Exists(file))
    {
        Console.Error.WriteLine($"File not found: {file}\nUsage: pdfua <file.pdf> [--json]");
        Environment.Exit(2);
    }
    
    try
    {
        var report = PdfUaValidator.Validate(file);
    
        if (asJson)
            Console.WriteLine(PdfUaValidator.ToJson(report, indented: true));
        else
            report.PrintText();
    
        bool hasBlocking = report.Findings.Any(f => f.Severity == "Error" && !f.Passed);
        Environment.Exit(hasBlocking ? 1 : 0);
    }
    catch (Exception ex)
    {
        Console.Error.WriteLine("Analysis failed:");
        Console.Error.WriteLine(ex);
        Environment.Exit(2);
    }
    ```
7. Create a folder named *documents* in the project directory and add a PDF/UA document named generated with TX Text Control as *result.pdf*. Set the file's *Copy to Output Directory* property to *Copy if newer*.

#### Starting the Application

Run the application. The console window will display the validation results, including any detected issues.

![Validation Results](https://s1-www.textcontrol.com/assets/dist/blog/2025/11/13/a/assets/results1.webp "Validation Results")

![Validation Results](https://s1-www.textcontrol.com/assets/dist/blog/2025/11/13/a/assets/results2.webp "Validation Results")

The validation results include a structured list of all the checks performed on the document. Each rule corresponds to a specific PDF/UA or PDF structure requirement and helps developers identify where a file might fail to comply.

| Rule | Description |
|---|---|
| SIG-PRESENT | Checks whether the document contains at least one digital signature field or signature annotation. |
| UA-CONFORMANCE | Verifies that the XMP metadata includes a declaration identifying the file as PDF/UA-1 conformant. |
| PDFA-CONFORMANCE | Reports whether a PDF/A conformance declaration is present. PDF/A is optional for PDF/UA and may be claimed in addition to PDF/UA (e.g., PDF/A-2a or PDF/A-3a); if present, its constraints must be met but it does not conflict with PDF/UA. |
| PDF-HEADER | Validates that the document begins with a proper PDF header and version identifier (e.g., %PDF-1.7). |
| PDF-XREF | Ensures that the file includes a valid cross-reference table or stream used to locate PDF objects. |
| UA-CATALOG | Checks that the root catalog dictionary is present and contains required entries such as /StructTreeRoot and /Lang. |
| UA-MARKED | Verifies that the document is tagged by inspecting the /MarkInfo dictionary with /Marked true. |
| UA-STRUCT | Ensures that a /StructTreeRoot entry exists, providing the logical structure tree for tagged content. |
| UA-MCID-ANCHOR | Checks that marked content elements (/MCID) are linked to structure elements using /StructParents anchors. |
| UA-TEXT-MAPPING | Verifies that all fonts define ToUnicode maps so that text can be programmatically extracted and read by assistive technology. |
| UA-LANG | Checks for the /Lang attribute at document or page level to define the primary language for screen readers. |
| UA-METADATA | Confirms that XMP metadata is embedded, containing general document information such as title and creator. |
| UA-TITLE | Ensures that the document has a meaningful title defined in the Info dictionary or in XMP dc:title metadata. |
| UA-TABS | Verifies that the /Tabs entry in page dictionaries is properly defined for consistent tab-order navigation. |
| UA-FIG-ALT | Checks that all figure elements include descriptive alternative text (/Alt or /ActualText) for accessibility. |
| UA-LINK-DESC | Ensures that link annotations contain text or tooltips describing their purpose for non-visual users. |
| UA-FORMS-TU | Checks that form fields define tooltips (/TU) so assistive technologies can announce their function. |
| UA-TABLE-A-SUMMARY | Verifies that table structures include /A elements with summaries describing their content. |
| UA-TABLE-HEADERS | Checks that table header cells are correctly defined and associated with data cells for proper reading order. |

As the sample output above shows, the document has no detected issues and is fully compliant with PDF/UA standards. The validation tool provides additional checks that are not relevant to PDF/UA, including a check for PDF/A, which can be generated using TX Text Control. Additionally, digital signatures can be verified, and the document can be checked to see if the content has changed since it was signed.

The detailed tables below the rules provide information that can be used to compare content or validate documents. These tables include extracted descriptive texts.

#### Export the Results in JSON Format

In this example, if you start the command-line tool with the --json parameter, it will return the results in JSON format.

```
{
  "filePath": "result.pdf",
  "pdfVersion": "1.7",
  "isPass": true,
  "documentTitle": "PDF Title",
  "documentLanguage": "en-US",
  "findings": [
    {
      "ruleId": "SIG-PRESENT",
      "severity": "Info",
      "passed": true,
      "message": "Digital signature present."
    },
    {
      "ruleId": "UA-CONFORMANCE",
      "severity": "Info",
      "passed": true,
      "message": "PDF/UA-1 conformance declaration found in XMP."
    },
    {
      "ruleId": "PDFA-CONFORMANCE",
      "severity": "Info",
      "passed": true,
      "message": "No PDF/A conformance declaration found (not required for PDF/UA)."
    },
    {
      "ruleId": "PDF-HEADER",
      "severity": "Error",
      "passed": true,
      "message": "Found PDF header %PDF-1.7."
    },
    {
      "ruleId": "PDF-XREF",
      "severity": "Warning",
      "passed": true,
      "message": "Cross-reference table/stream appears present."
    },
    {
      "ruleId": "UA-CATALOG",
      "severity": "Error",
      "passed": true,
      "message": "Catalog dictionary present."
    },
    ...
  ]
}
```

#### Accessing the Results via the API

You can also access the report results directly via the API. The following code snippet validates a PDF and lists all image descriptions.

```
var report = PdfUaValidator.Validate(file);

foreach (var figure in report.Figures)
{
    Console.WriteLine($"Figure: {figure.AltText}");
}
```

#### Download the NuGet Package

You can download the **TXTextControl.PDF.Validation** NuGet package from [nuget.org](https://www.nuget.org/packages/TXTextControl.PDF.Validation) or install it via the NuGet Package Manager Console:

```
Install-Package TXTextControl.PDF.Validation -Version 34.0.0-beta.1
```

### Conclusion

The TXTextControl.PDF.Validation NuGet package is a powerful tool that helps developers ensure their PDF documents meet accessibility standards and maintain integrity through digital signatures. Integrating this validation into your .NET applications enhances the accessibility and reliability of your PDF outputs, ensuring compliance with industry standards.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Validate Digital Signatures and the Integrity of PDF Documents in C# .NET](https://www.textcontrol.com/blog/2025/11/14/validate-digital-signatures-and-the-integrity-of-pdf-documents-in-csharp-dotnet/llms.txt)
- [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/llms.txt)
- [Automating PDF/UA Accessibility with AI: Describing DOCX Documents Using TX Text Control and LLMs](https://www.textcontrol.com/blog/2025/10/16/automating-pdf-ua-accessibility-with-ai-describing-docx-documents-using-tx-text-control-and-llms/llms.txt)
- [Why PDF/UA and PDF/A-3a Matter: Accessibility, Archiving, and Legal Compliance](https://www.textcontrol.com/blog/2025/10/07/why-pdf-ua-and-pdf-a-3a-matter-accessibility-archiving-and-legal-compliance/llms.txt)
- [AI Natural Language Document Generation with MCP and TX Text Control .NET](https://www.textcontrol.com/blog/2026/07/16/ai-natural-language-document-generation-with-mcp-server-and-tx-text-control-dotnet/llms.txt)
- [C# Document Generation: A Developer's Guide for .NET](https://www.textcontrol.com/blog/2026/07/08/csharp-document-generation-developer-guide-for-dotnet/llms.txt)
- [TX Text Control vs IronPDF for Enterprise PDF Workflows: Complete Comparison Guide](https://www.textcontrol.com/blog/2026/04/28/tx-text-control-vs-ironpdf-for-enterprise-pdf-workflows-complete-comparison-guide/llms.txt)
- [Using QR Codes in PDF Documents in C# .NET](https://www.textcontrol.com/blog/2026/04/21/using-qr-codes-in-pdf-documents-in-csharp-dotnet/llms.txt)
- [Why Structured E-Invoices Still Need Tamper Protection using C# and .NET](https://www.textcontrol.com/blog/2026/03/24/why-structured-e-invoices-still-need-tamper-protection-using-csharp-and-dotnet/llms.txt)
- [AI Generated PDFs, PDF/UA, and Compliance Risk: Why Accessible Document Generation Must Be Built Into the Pipeline in C# .NET](https://www.textcontrol.com/blog/2026/03/23/ai-generated-pdfs-pdf-ua-and-compliance-risk-why-accessible-document-generation-must-be-built-into-the-pipeline-in-c-sharp-dot-net/llms.txt)
- [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/llms.txt)
- [Why HTML to PDF Conversion is Often the Wrong Choice for Business Documents in C# .NET](https://www.textcontrol.com/blog/2026/03/13/why-html-to-pdf-conversion-is-often-the-wrong-choice-for-business-documents-in-csharp-dot-net/llms.txt)
- [A Complete Guide to Converting Markdown to PDF in .NET C#](https://www.textcontrol.com/blog/2026/01/07/a-complete-guide-to-converting-markdown-to-pdf-in-dotnet-csharp/llms.txt)
- [Why PDF Creation Belongs at the End of the Business Process](https://www.textcontrol.com/blog/2026/01/02/why-pdf-creation-belongs-at-the-end-of-the-business-process/llms.txt)
- [Designing the Perfect PDF Form with TX Text Control in .NET C#](https://www.textcontrol.com/blog/2025/12/16/designing-the-perfect-pdf-form-with-tx-text-control-in-dotnet-csharp/llms.txt)
- [Why Defining MIME Types for PDF/A Attachments Is Essential](https://www.textcontrol.com/blog/2025/12/10/why-defining-mime-types-for-pdfa-attachments-is-essential/llms.txt)
- [How To Choose the Right C# PDF Generation Library: Developer Checklist](https://www.textcontrol.com/blog/2025/11/12/how-to-choose-the-right-csharp-pdf-generation-library-developer-checklist/llms.txt)
- [Introducing TX Text Control 34.0: Your Next Leap in Document Processing](https://www.textcontrol.com/blog/2025/11/10/introducing-tx-text-control-34-0-your-next-leap-in-document-processing/llms.txt)
- [Why Digitally Signing your PDFs is the Only Reliable Way to Prevent Tampering](https://www.textcontrol.com/blog/2025/10/30/why-digitally-signing-your-pdfs-is-the-only-reliable-way-to-prevent-tampering/llms.txt)
- [PDF/UA vs. PDF/A-3a: Which Format Should You Use for Your Business Application?](https://www.textcontrol.com/blog/2025/10/24/pdf-ua-vs-pdf-a-3a-which-format-should-you-use-for-your-business-application/llms.txt)
- [Validating PDF/UA Documents in .NET C#](https://www.textcontrol.com/blog/2025/10/21/validating-pdf-ua-documents-in-dotnet-csharp/llms.txt)
- [Converting Office Open XML (DOCX) to PDF in Java](https://www.textcontrol.com/blog/2025/10/14/converting-office-open-xml-docx-to-pdf-in-java/llms.txt)
- [Extending DS Server with Custom Digital Signature APIs](https://www.textcontrol.com/blog/2025/10/09/extending-ds-server-with-custom-digital-signature-apis/llms.txt)
- [Convert Markdown to PDF in a Console Application on Linux and Windows](https://www.textcontrol.com/blog/2025/09/23/convert-markdown-to-pdf-in-a-console-application-on-linux-and-windows/llms.txt)
- [Mining PDFs with Regex in C#: Practical Patterns, Tips, and Ideas](https://www.textcontrol.com/blog/2025/08/12/mining-pdfs-with-regex-in-csharp-practical-patterns-tips-and-ideas/llms.txt)
