TXTextControl.PDF.Validation 34.1.0

Prefix Reserved
dotnet add package TXTextControl.PDF.Validation --version 34.1.0
                    
NuGet\Install-Package TXTextControl.PDF.Validation -Version 34.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TXTextControl.PDF.Validation" Version="34.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TXTextControl.PDF.Validation" Version="34.1.0" />
                    
Directory.Packages.props
<PackageReference Include="TXTextControl.PDF.Validation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TXTextControl.PDF.Validation --version 34.1.0
                    
#r "nuget: TXTextControl.PDF.Validation, 34.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TXTextControl.PDF.Validation@34.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TXTextControl.PDF.Validation&version=34.1.0
                    
Install as a Cake Addin
#tool nuget:?package=TXTextControl.PDF.Validation&version=34.1.0
                    
Install as a Cake Tool

TXTextControl.PDF.Validation

TXTextControl.PDF.Validation is a .NET library for validating PDF/UA accessibility characteristics in PDF documents.

The library returns a structured validation report with PDF/UA findings, extracted document information, and separate document diagnostics for signatures and encryption.

Requirements

  • .NET 10
  • Read access to the PDF file or PDF bytes to validate

Installation

Reference the package or project from your application:

<PackageReference Include="TXTextControl.PDF.Validation" Version="34.1.0" />

Quick Start

using TXTextControl.PDF.Validation;
using TXTextControl.PDF.Validation.Model;

Report report = PdfUaValidator.Validate("document.pdf");

Console.WriteLine(report.Status);

foreach (Finding finding in report.Findings)
{
    Console.WriteLine($"{finding.Severity} {finding.RuleId}: {finding.Message}");
}

Validate PDF Bytes

byte[] pdf = File.ReadAllBytes("document.pdf");
Report report = PdfUaValidator.Validate(pdf);

JSON Output

Report report = PdfUaValidator.Validate("document.pdf");
string json = PdfUaValidator.ToJson(report, indented: true);

Console.WriteLine(json);

The JSON output includes:

  • status
  • isPass
  • findings
  • tableSummaries
  • links
  • figures
  • forms
  • standards
  • diagnostics.signatures
  • diagnostics.encryption

Validation Status

Every report has a top-level Status value:

Status Meaning
Passed Validation completed and no blocking PDF/UA errors or warnings were detected.
CompletedWithWarnings Validation completed, no blocking PDF/UA errors were detected, but one or more warning findings were reported.
Failed Validation completed and one or more blocking PDF/UA errors were detected.
Blocked Validation could not fully run, for example because the PDF is encrypted.

Report.IsPass is kept as a convenience property. It returns true for Passed and CompletedWithWarnings, and false for Failed and Blocked.

Report Model

The main report type is TXTextControl.PDF.Validation.Model.Report.

Important properties:

Property Description
FilePath File name or path used for validation.
PdfVersion Detected PDF version.
Status Overall validation status.
IsPass Compatibility boolean derived from Status.
Findings PDF/UA and PDF syntax findings.
StandardDecls Detected standard declarations such as PDF/UA metadata.
DocumentTitle Detected document title.
DocumentLanguage Detected document or page language.
TableSummaries Extracted table summaries and header information.
Links Extracted link annotations and targets.
Figures Extracted figure alternate text information.
Forms Extracted form fields and tooltip information.
Diagnostics Non-PDF/UA diagnostics such as signatures and encryption.

Findings

Each finding contains:

Property Description
RuleId Stable rule/check identifier.
Category Checkpoint category, such as Metadata, Structure Tree, Fonts, or Security.
Severity Info, Warning, or Error.
Passed Whether the check passed.
Message Human-readable result message.

Only failed Error findings make the report status Failed. Failed Warning findings make the status CompletedWithWarnings unless an error is also present.

What Is Checked

The validator checks the following areas:

  • PDF syntax basics, including header and cross-reference presence
  • PDF/UA metadata and conformance declarations
  • document title and XMP metadata
  • natural language declarations
  • tagged PDF markers
  • structure tree presence and selected structure consistency checks
  • role mapping
  • fonts, embedded font references, and ToUnicode maps
  • alternate descriptions for figures
  • links and link descriptions
  • form fields and tooltip coverage
  • tables, summaries, and selected header relationships
  • embedded files and file specification metadata
  • document settings such as page tabs and display document title
  • optional content
  • XFA detection
  • security/encryption detection
  • navigation structures
  • annotations
  • actions and XObjects

Signed PDFs

Signed PDFs can be validated normally.

Signature validation is reported separately under:

report.Diagnostics.Signatures

Signature diagnostics include:

  • number of signatures
  • signature byte integrity
  • whether each signature covers the whole document
  • signer subject
  • signing time
  • subfilter
  • ByteRange values
  • /Contents gap range
  • verification failure details, if any

Signature diagnostics do not affect PDF/UA pass/fail status. A broken signature is a document diagnostic, not a PDF/UA validation error.

Encrypted PDFs

Encrypted or password-protected PDFs are not decrypted by this library.

If an encrypted PDF is detected:

  • report.Status is Blocked
  • report.IsPass is false
  • report.Diagnostics.Encryption.IsEncrypted is true
  • a failed UA-SECURITY-ENCRYPTED finding is added
  • PDF/UA validation stops before content, tags, forms, links, and alternate text are inspected

This behavior is intentional. The validator does not include a PDF decryption engine or external PDF processing dependency.

Console Tester

The repository includes pdfuatester, a small console application for manual validation.

Run the default signed sample:

dotnet run --project pdfuatester -c Release

The default sample is:

documents/result-7.pdf

It runs the full PDF/UA validation and prints signature diagnostics.

Validate a specific file:

dotnet run --project pdfuatester -c Release -- path\to\document.pdf

Validate all bundled samples:

dotnet run --project pdfuatester -c Release -- --all

Emit JSON:

dotnet run --project pdfuatester -c Release -- path\to\document.pdf --json

Scope and Limitations

The validator is designed to provide structured PDF/UA validation coverage without embedding a full general-purpose PDF processor.

Some checks are precise model-based validations. Others are conservative review signals where complete validation requires deeper PDF interpretation, for example:

  • exact /ParentTree to /OBJR annotation linkage
  • link annotation nesting under /Link
  • widget annotation nesting under /Form
  • Form XObject structure incorporation
  • full MCID-to-structure-parent validation for every marked-content sequence
  • semantic review of outlines, page labels, and action behavior

These areas may be reported as informational review findings instead of hard failures when the validator cannot prove an error from the available model.

API Reference

public static class PdfUaValidator
{
    public static Report Validate(string pdfPath);
    public static Report Validate(byte[] pdfData);
    public static string ToJson(Report report, bool indented = false);
}

Namespace:

TXTextControl.PDF.Validation

Model namespace:

TXTextControl.PDF.Validation.Model
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
34.1.0 92 7/6/2026
34.0.0-beta.1 279 11/12/2025