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.

We released a beta version of 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.
-
In Visual Studio 2022, create a new project by choosing Create a new project.
-
Select Console App as the project template and confirm with Next.
-
Enter a project name and choose a location to save the project. Confirm with Next.
-
Choose .NET 8.0 (Long Term Support) as the Framework.

Adding the NuGet Packages
-
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

Validating a PDF Document
-
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); } -
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.


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 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.
ASP.NET
Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.
- Angular
- Blazor
- React
- JavaScript
- ASP.NET MVC, ASP.NET Core, and WebForms
Related Posts
Automating PDF/UA Accessibility with AI: Describing DOCX Documents Using TX…
This article shows how to use TX Text Control together with the OpenAI API to automatically add descriptive texts (alt text and labels) to images, links, and tables in a DOCX. The resulting…
Why PDF/UA and PDF/A-3a Matter: Accessibility, Archiving, and Legal Compliance
It is more important than ever to ensure that documents are accessible, archivable, and legally compliant. PDF/UA and PDF/A-3a are two effective standards for addressing these needs. This article…
How To Choose the Right C# PDF Generation Library: Developer Checklist
To make your choice easy, this guide provides a systematic evaluation framework for two library categories: basic and enterprise PDF libraries. It covers matching features to use cases, evaluating…
Introducing TX Text Control 34.0: Your Next Leap in Document Processing.
We are happy to announce the release of TX Text Control 34.0. This version is packed with new features and enhancements that will elevate your document processing experience. This version…
ASP.NETASP.NET CoreDigital Signatures
Why Digitally Signing your PDFs is the Only Reliable Way to Prevent Tampering
PDF documents are widely used for sharing information because of their fixed layout and cross-platform compatibility. However, it is crucial to ensure the integrity and authenticity of these…
