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
<PackageReference Include="TXTextControl.PDF.Validation" Version="34.1.0" />
<PackageVersion Include="TXTextControl.PDF.Validation" Version="34.1.0" />
<PackageReference Include="TXTextControl.PDF.Validation" />
paket add TXTextControl.PDF.Validation --version 34.1.0
#r "nuget: TXTextControl.PDF.Validation, 34.1.0"
#:package TXTextControl.PDF.Validation@34.1.0
#addin nuget:?package=TXTextControl.PDF.Validation&version=34.1.0
#tool nuget:?package=TXTextControl.PDF.Validation&version=34.1.0
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:
statusisPassfindingstableSummarieslinksfiguresformsstandardsdiagnostics.signaturesdiagnostics.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
/Contentsgap 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.StatusisBlockedreport.IsPassisfalsereport.Diagnostics.Encryption.IsEncryptedistrue- a failed
UA-SECURITY-ENCRYPTEDfinding 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
/ParentTreeto/OBJRannotation 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 | Versions 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. |
-
net10.0
- System.Security.Cryptography.Pkcs (>= 9.0.10)
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 |