โก Easy Accessibility โ One-Line PDF/UA
Enable full PDF/UA-1 accessibility with a single method call. EnableAccessibility() auto-tags text, text blocks, and images โ no manual structure tree required.
C# โ Before & After
โ Before โ Manual Tagging (10+ lines)
var doc = new PdfDocument();
doc.Info.Title = "My Document";
doc.Language = "en-US";
doc.DisplayDocTitle = true;
doc.PdfUaConformance = PdfUaConformanceLevel.PdfUA1;
var root = doc.EnableTaggedPdf();
var sect = root.AddChild(StructureType.Sect);
var h1 = sect.AddChild(StructureType.H1);
var p = sect.AddChild(StructureType.P);
var page = doc.AddPage();
page.AddTaggedText(h1, "Hello", 72, 720,
new PdfTextOptions { Font = StandardFont.HelveticaBold,
FontSize = 24 });
page.AddTaggedText(p, "World", 72, 690);
doc.Save("manual.pdf");
โ
After โ EnableAccessibility() (5 lines)
var doc = new PdfDocument();
doc.EnableAccessibility("en-US", "My Document");
var page = doc.AddPage();
page.AddText("Hello", 72, 720,
new PdfTextOptions { Font = StandardFont.HelveticaBold,
FontSize = 24 });
page.AddText("World", 72, 690);
doc.Save("easy.pdf");
Complete Example โ All Languages
Easy Accessibility with Images
using ObviousPDF;
using ObviousPDF.Fonts;
var doc = new PdfDocument();
doc.EnableAccessibility("en-US", "Easy Accessibility Demo");
var page = doc.AddPage();
// Text is auto-tagged as <P> structure elements
page.AddText("Welcome to ObviousPDF", 72, 720,
new PdfTextOptions { Font = StandardFont.HelveticaBold,
FontSize = 22 });
page.AddText("This PDF is fully accessible.", 72, 690);
// Multi-line text blocks are also auto-tagged
page.AddTextBlock(new[] {
"Auto-tagging creates structure elements",
"for every text and image call."
}, 72, 650);
// Images with altText are auto-tagged as <Figure>
var logo = PdfImage.FromJpegFile("logo.jpg");
page.AddImage(logo, 72, 500, 200, 100,
"Company logo โ ObviousPDF");
// Decorative content โ artifacts (unchanged)
page.BeginArtifact(PdfArtifactType.Pagination);
page.AddText("Page 1", 285, 30);
page.EndArtifact();
doc.Save("easy_accessible.pdf");
Imports ObviousPDF
Imports ObviousPDF.Fonts
Dim doc As New PdfDocument()
doc.EnableAccessibility("en-US", "Easy Accessibility Demo")
Dim page = doc.AddPage()
' Text is auto-tagged as <P> structure elements
page.AddText("Welcome to ObviousPDF", 72, 720,
New PdfTextOptions With {
.Font = StandardFont.HelveticaBold,
.FontSize = 22 })
page.AddText("This PDF is fully accessible.", 72, 690)
' Images with altText are auto-tagged as <Figure>
Dim logo = PdfImage.FromJpegFile("logo.jpg")
page.AddImage(logo, 72, 500, 200, 100,
"Company logo โ ObviousPDF")
doc.Save("easy_accessible.pdf")
open ObviousPDF
open ObviousPDF.Fonts
let doc = PdfDocument()
doc.EnableAccessibility("en-US", "Easy Accessibility Demo")
let page = doc.AddPage()
// Text is auto-tagged as <P> structure elements
page.AddText("Welcome to ObviousPDF", 72.0, 720.0,
PdfTextOptions(Font = StandardFont.HelveticaBold,
FontSize = 22.0))
page.AddText("This PDF is fully accessible.", 72.0, 690.0)
// Images with altText are auto-tagged as <Figure>
let logo = PdfImage.FromJpegFile("logo.jpg")
page.AddImage(logo, 72.0, 500.0, 200.0, 100.0,
"Company logo โ ObviousPDF")
doc.Save("easy_accessible.pdf")
Add-Type -Path "ObviousPDF.dll"
$doc = [ObviousPDF.PdfDocument]::new()
$doc.EnableAccessibility("en-US", "Easy Accessibility Demo")
$page = $doc.AddPage()
# Text is auto-tagged as <P> structure elements
$page.AddText("Welcome to ObviousPDF", 72, 720,
[ObviousPDF.PdfTextOptions]@{
Font = [ObviousPDF.Fonts.StandardFont]::HelveticaBold
FontSize = 22 })
$page.AddText("This PDF is fully accessible.", 72, 690)
# Images with altText are auto-tagged as <Figure>
$logo = [ObviousPDF.PdfImage]::FromJpegFile("logo.jpg")
$page.AddImage($logo, 72, 500, 200, 100,
"Company logo โ ObviousPDF")
$doc.Save("easy_accessible.pdf")
What EnableAccessibility() Does
| Setting | Value |
|---|---|
Language | Set to the language parameter (default "en") |
Info.Title | Set to the title parameter (if provided) |
DisplayDocTitle | true |
PdfUaConformance | PdfUA1 |
| Tagged PDF | Enabled (structure tree created) |
| Auto-tagging | AddText โ <P>, AddImage(..., altText) โ <Figure> |
Each page gets a /Sect parent element. Every AddText and AddTextBlock call creates a /P child. Every AddImage or AddImageScaled with an altText parameter creates a /Figure with the alt text and bounding box set automatically.
JSON โ Easy Accessibility
In ObviousPDF.Json, set "accessible": true at the root level. This replaces the manual tagged, structureTree, conformance, and displayDocTitle settings entirely.
โ Before โ Manual Structure Tree
{
"tagged": true,
"document": {
"language": "en-US",
"displayDocTitle": true,
"info": { "title": "My Report" },
"conformance": { "pdfUa": "PdfUA1" }
},
"structureTree": {
"type": "Document",
"children": [
{ "type": "H1", "id": "h1" },
{ "type": "P", "id": "p1" }
]
},
"pages": [{
"size": "Letter",
"content": [
{ "type": "text", "structureId": "h1",
"text": "Title", "x": 72, "y": 72 },
{ "type": "text", "structureId": "p1",
"text": "Body.", "x": 72, "y": 100 }
]
}]
}
โ
After โ
"accessible": true{
"accessible": true,
"document": {
"language": "en-US",
"info": { "title": "My Report" }
},
"pages": [{
"size": "Letter",
"content": [
{ "type": "text",
"text": "Title", "x": 72, "y": 72 },
{ "type": "text",
"text": "Body.", "x": 72, "y": 100 }
]
}]
}
When to Use Each Approach
| Approach | Best For | Limitations |
|---|---|---|
EnableAccessibility() / "accessible": true | Quick documents, reports, simple layouts, prototyping | Flat structure (P + Figure only); no H1โH6 heading hierarchy, no tables, no lists |
Manual tagging (EnableTaggedPdf()) | Complex documents, forms, government PDFs, full PDF/UA compliance with rich semantics | More code; requires understanding of structure types and parent-child rules |
| Hybrid | Best of both โ use EnableAccessibility() for auto-tagging + add manual structure where needed | Requires care not to double-tag elements |
โ ๏ธ Disclaimer: The automated accessibility features and reports provided by ObviousPDF are intended solely to assist in the assessment of document accessibility. They are not a comprehensive accessibility audit. To confirm that WCAG or PDF/UA standards are fully met, it is recommended to have human assessment by an accessibility specialist.