โšก 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.

๐Ÿ†• New in v1.2.0

EnableAccessibility() is the fastest way to make any PDF accessible. It configures PDF/UA-1 conformance, enables tagged PDF, sets the document language, and turns on auto-tagging so every call to AddText, AddTextBlock, and AddImage automatically creates the correct structure elements (P for text, Figure for images). For JSON documents, set "accessible": true for the same effect.

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

SettingValue
LanguageSet to the language parameter (default "en")
Info.TitleSet to the title parameter (if provided)
DisplayDocTitletrue
PdfUaConformancePdfUA1
Tagged PDFEnabled (structure tree created)
Auto-taggingAddText โ†’ <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 }
    ]
  }]
}

๐Ÿ“„ Form 1040 โ€” Easy Accessibility Edition

We've created form-1040ea.json โ€” the same 3-page IRS Form 1040 rendered with "accessible": true instead of a manual structure tree. The JSON is dramatically simpler while still producing a PDF/UA-conformant document.

๐Ÿ“„ Download form-1040ea.json ๐Ÿ“„ Original form-1040.json (manual tags)

When to Use Each Approach

ApproachBest ForLimitations
EnableAccessibility() / "accessible": trueQuick documents, reports, simple layouts, prototypingFlat 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 semanticsMore code; requires understanding of structure types and parent-child rules
HybridBest of both โ€” use EnableAccessibility() for auto-tagging + add manual structure where neededRequires care not to double-tag elements

๐Ÿ’ก Tip: Combine Both Approaches

You can call EnableAccessibility() for the auto-tagging foundation, then use AddTaggedText() with manual structure elements for sections that need richer semantics (headings, tables, lists). The auto-tagging only applies to plain AddText/AddTextBlock/AddImage calls โ€” tagged methods are unaffected.

โš ๏ธ 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.