Validate PDF conformance
PDF conformance validation verifies that a document actually complies with the archival (PDF/A) or accessibility (PDF/UA) standard it claims. A document that carries a PDF/A or PDF/UA identifier in its metadata isn’t guaranteed to satisfy the standard — files produced by external tools, edited after conversion, or assembled from mixed sources often violate the requirements they declare.
Use this workflow when you need to:
- Verify documents before accepting them into long-term storage
- Audit existing document repositories against declared standards
- Confirm the output of a PDF/A or PDF/UA conversion pipeline
- Test documents against PDF/UA before publication
Prepare the project
Register the SDK license before running validation operations. For setup details, refer to the getting started with .NET SDK guide.
using GdPicture14;
LicenseManager licence = new LicenseManager();licence.RegisterKEY(""); // Set your license keyLoad the PDF document
Create a GdPicturePDF instance and load the source file:
using GdPicturePDF pdf = new GdPicturePDF();pdf.LoadFromFile(@"input_pdfa_valid.pdf");Detect the claimed conformance
Read the conformance level the document claims in its metadata:
PdfConformance claimedConformance = pdf.GetPDFConformance();Console.WriteLine($"Claimed conformance: {claimedConformance}");GetPDFConformance reports PDF/A and PDF/UA conformance claims. For documents without a claim, it reports the PDF version instead.
Validate the claimed PDF/A conformance
Validate the document against the PDF/A conformance level it claims, and write the detailed report to a file:
string report = string.Empty;bool isValid = pdf.IsValidPDFA(ref report);Console.WriteLine($"PDF/A validation result: {isValid}");
File.WriteAllText(@"report.xml", report);IsValidPDFA returns true when the document complies with the standard it claims. The report is a machine-readable XML document. When the file doesn’t comply, the report lists every problem found during validation.
To validate a claimed PDF/UA conformance instead, use the IsValidPDFUA method in the same way.
Validate against a specific conformance level
To check a document against a standard it doesn’t claim — for example, to test whether an archival document is also accessible — request the target conformance level explicitly:
string uaReport = string.Empty;bool isUaConformant = pdf.CheckPDFUAConformance(PdfValidationConformance.PDF_UA_1, ref uaReport);Console.WriteLine($"PDF/UA-1 validation result: {isUaConformant}");
pdf.CloseDocument();The sample document is a valid PDF/A file, so the PDF/UA-1 check reports it as not conformant — the accessibility standard imposes tagging and structure requirements that archival conformance doesn’t.
To validate against a specific PDF/A level, use the CheckPDFAConformance method with the same signature.
Supported conformance levels
The PdfValidationConformance enumeration covers all supported validation targets:
- PDF/A-1a, PDF/A-1b
- PDF/A-2a, PDF/A-2u, PDF/A-2b
- PDF/A-3a, PDF/A-3u, PDF/A-3b
- PDF/A-4, PDF/A-4e, PDF/A-4f
- PDF/UA-1
Handle errors
In production, validate:
- Input file availability and format
- Operation status after loading and validation, using the
GetStatmethod - Encryption state — validation requires an unencrypted document
For status-handling patterns, refer to the handling errors with .NET SDK guide.
Conclusion
This guide verifies that a PDF document genuinely complies with the archival or accessibility standard it claims. To produce compliant documents from regular PDF files, refer to the PDF-to-PDF/A and PDF-to-PDF/UA guides.