โฟ Accessible Document โ PDF/UA Compliant
The recommended pattern for every production document. Fully accessible with tagged structure, reading order, and artifact marking.
C# โ Accessible Document
using ObviousPDF;
using ObviousPDF.Accessibility;
var doc = new PdfDocument();
// Step 1: Required document metadata
doc.Info.Title = "Accessible Document";
doc.Language = "en-US"; // REQUIRED
doc.DisplayDocTitle = true; // REQUIRED
doc.PdfUaConformance =
PdfUaConformanceLevel.PdfUA1; // Declare conformance
// Step 2: Enable tagged PDF
var root = doc.EnableTaggedPdf();
// Step 3: Build structure tree
var sect = root.AddChild(StructureType.Sect);
var h1 = sect.AddChild(StructureType.H1);
var pIntro = sect.AddChild(StructureType.P);
// List structure
var list = sect.AddChild(StructureType.L);
var li1 = list.AddChild(StructureType.LI);
var li1Lbl = li1.AddChild(StructureType.Lbl);
var li1Body = li1.AddChild(StructureType.LBody);
// Step 4: Add tagged content to page
var page = doc.AddPage();
// Decorative header โ ARTIFACT (not structural)
page.BeginArtifact(PdfArtifactType.Layout);
page.FillRectangle(0, 760, 612, 32,
new PdfDrawOptions {
FillColor = PdfColor.FromRgb(0.15, 0.3, 0.6)
});
page.EndArtifact();
// Tagged heading
page.AddTaggedText(h1, "Welcome to ObviousPDF",
72, 720, new PdfTextOptions {
Font = StandardFont.HelveticaBold,
FontSize = 22
});
// Tagged paragraph
page.AddTaggedText(pIntro,
"This document is fully accessible.",
72, 690);
// Tagged list items
page.AddTaggedText(li1Lbl, "โข", 82, 660);
page.AddTaggedText(li1Body,
"Tagged PDF for screen readers",
95, 660);
// Page number โ ARTIFACT
page.AddArtifactText("Page 1", 285, 30,
PdfArtifactType.Pagination);
// Step 5: Validate
var checker = new PdfAccessibilityChecker();
var report = checker.Check(doc);
// report.IsFullyCompliant == true โ
doc.Save("accessible.pdf");
You should see a solid dark-blue header bar spanning the full page width, a bold 22 pt heading "Welcome to ObviousPDF", a short introductory paragraph, and one bulleted list item reading "Tagged PDF for screen readers". A "Page 1" artifact appears at the bottom centre. In Adobe Acrobat's Tags panel the tree should show Document โบ Sect โบ H1, P, L โบ LI โบ Lbl, LBody.
File: 05_accessible_document.pdf
PDF/UA Checklist
| Requirement | Code | PDF/UA Clause |
|---|---|---|
| Document language | doc.Language = "en-US" | ยง7.1 |
| Document title | doc.Info.Title = "..." | ยง7.1 |
| Display title in viewer | doc.DisplayDocTitle = true | ยง7.1 |
| Tagged PDF enabled | doc.EnableTaggedPdf() | ยง7.1 |
| All content tagged | AddTaggedText() | ยง7.2 |
| Decorative content as artifacts | BeginArtifact() | ยง7.1 |
| Correct heading hierarchy | H1 โ H2 โ H3 (no skipping) | ยง7.4.2 |
| Figures have alt text + BBox | AddChild(Figure, "alt") | ยง7.3 |
| PDF/UA identifier | PdfUaConformanceLevel.PdfUA1 | ยง6.7.11 |