Add tagged PDF infrastructure for Section 508 accessibility#67
Open
craigmcnamara wants to merge 4 commits intoprawnpdf:masterfrom
Open
Add tagged PDF infrastructure for Section 508 accessibility#67craigmcnamara wants to merge 4 commits intoprawnpdf:masterfrom
craigmcnamara wants to merge 4 commits intoprawnpdf:masterfrom
Conversation
Adds marked content operators (BMC/BDC/EMC) and structure tree support to pdf-core, enabling accessible/tagged PDF generation. This is the foundation layer that Prawn and Prawn::Table will build on. New modules: - PDF::Core::MarkedContent — emits BMC/BDC/EMC operators in content streams - PDF::Core::StructureTree — manages StructTreeRoot, structure elements, ParentTree, and MCID allocation Modified: - ObjectStore: accepts marked: true, sets /MarkInfo on Catalog - DocumentState: threads marked option through to ObjectStore - Renderer: includes MarkedContent, creates StructureTree when marked, registers before_render callback for structure tree finalization Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allows setting /ActualText on structure elements so screen readers announce replacement text instead of reading visual characters literally (e.g., "required" instead of "asterisk" for *, "selected" for X). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Mar 26, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the low-level foundation for generating tagged (accessible) PDFs compliant with GSA Section 508 guidelines.
PDF::Core::MarkedContentmodule — emits BMC/BDC/EMC operators in content streams for marking content sequencesPDF::Core::StructureTreeclass — manages the StructTreeRoot, structure elements (/StructElem), ParentTree (number tree), and per-page MCID allocation. Finalizes automatically viabefore_rendercallback.ObjectStore— acceptsmarked: trueoption, sets/MarkInfo << /Marked true >>on the CatalogDocumentState— threads themarkedoption through to ObjectStoreRenderer— includesMarkedContent, createsStructureTreewhen marked, sets minimum PDF version to 1.7, exposesstructure_treeandmarked?accessors/Alt,/ActualText,/Lang, and/Scopeattributes on structure elementsThis is the foundation layer that prawnpdf/prawn and prawnpdf/prawn-table build on for high-level accessibility APIs. See companion PRs there.
Addresses prawnpdf/prawn-table#78
Test plan
🤖 Generated with Claude Code