PDF Tagged Content
Marked content in a PDF page stream — spans of page content bracketed by BMC/BDC and EMC operators, associating that content with a tag and optional property dictionary — used to link structure tree elements to their rendered glyphs and graphics on the page.
Tagged content is the mechanism that connects a PDF's logical structure tree to the actual rendered glyphs, paths, and images on each page. Without this connection, the structure tree would describe the document's logical organisation — headings, paragraphs, tables — but would have no way to tell a PDF viewer or assistive technology which specific pixels on a page correspond to which structure element.
Marked content operators in the PDF content stream act as brackets around specific sequences of drawing instructions, tagging those instructions with a structure element identifier. When a screen reader processes the document, it follows the structure tree, and at each leaf element finds a pointer to a sequence of marked content in the page stream — the actual text or graphic to be announced.
Tagged content (and its counterpart, <a href="https://pdftheguide.com/glossary/pdf-artifact" target="_blank" rel="noopener">PDF artifacts</a>) is the lowest-level mechanism of <a href="https://pdftheguide.com/glossary/tagged-pdf" target="_blank" rel="noopener">tagged PDF</a> accessibility. Understanding it is essential for anyone building PDF accessibility tools, debugging screen reader behaviour, or understanding why a tagged PDF still fails accessibility tests.
Marked content operators
The PDF content stream contains three operators for marking content:
**BMC (Begin Marked Content)** — Opens a marked content sequence with a tag name: ``` /P BMC % begin tagged paragraph content BT /F1 12 Tf 100 700 Td (This is a paragraph.) Tj ET EMC % end marked content ```
**BDC (Begin Marked Content with Properties)** — Opens a marked content sequence with a tag name and a property dictionary (or reference to one): ``` /P <</MCID 0>> BDC % P tag with marked content ID 0 BT /F1 12 Tf 100 700 Td (Paragraph text.) Tj ET EMC ```
**EMC (End Marked Content)** — Closes the most recently opened marked content sequence.
The `/MCID` (Marked Content Identifier) is a non-negative integer that uniquely identifies this marked content sequence within the page. Structure tree leaf elements use the MCID to reference the actual content on the page. The structure element in the tag tree contains: ``` << /Type /MCR % Marked Content Reference /Pg 5 0 R % reference to the page /MCID 0 % the MCID that labels this content on that page >> ```
MCID assignment and structure tree linking
The full mechanism for linking structure elements to page content works through MCIDs:
1. **Page content stream** — Drawing operators are bracketed by `BDC ... EMC` with a `/MCID N` property. The integer N is assigned by the PDF generator.
2. **Structure element (in the structure tree)** — Contains a `/K` (Kids) array that lists the content it contains. For leaf-level structure elements that directly contain rendered content, `/K` entries are either: - A direct MCID integer (if the content is on the page the structure element is associated with) - A Marked Content Reference dictionary (`/Type /MCR`, `/Pg`, `/MCID`) if the structure element spans multiple pages or needs to explicitly reference a specific page
3. **The link** — When a PDF viewer or accessibility tool encounters a structure element of type `P` (paragraph) with `/K 0`, it knows: "the content for this paragraph is the marked content with MCID 0 on the associated page." It can then render, extract, or announce that content.
This three-layer architecture — structure tree → marked content reference → content stream — is what makes PDF the most structurally sophisticated format for accessible documents. It supports: - Reflow (reordering content by structure tree order, not page position) - Text extraction for assistive technology (following the structure tree order) - Selective content export (extracting just the tagged content, skipping artifacts)
Common problems with tagged content in practice
Tagged content problems are among the most common causes of PDF/UA failures. Typical issues:
**Untagged content** — Drawing operators with no surrounding `BDC ... EMC`. The content is rendered visually but is invisible to the structure tree. Screen readers skip it or process it separately in "raw content" mode. Very common in PDFs generated by tools that add content without updating the tag tree (overlays, stamps, watermarks added post-generation).
**Incorrect MCID assignment** — A structure element references an MCID that does not exist on the referenced page, or references an MCID used by a different element. The resulting PDF fails PDF/UA validation with a "content not tagged" or "tag not associated" error.
**Wrong reading order** — MCID values are assigned by the order content is drawn, which may not match the logical reading order. For multi-column layouts, content is often drawn left-column-then-right-column, but the structure tree should reflect reading order, not drawing order. If the structure tree `/K` MCIDs are in the wrong order, screen reader reading order will be wrong.
**Nested marked content without correct nesting** — Marked content sequences must be properly nested. A `BDC ... BDC ... EMC ... EMC` pattern is required if an inner marked content sequence is nested inside an outer one. Mismatched `BDC`/`EMC` operators are a parsing error.
**Appearance stream content not tagged** — Annotations with `/AP` (appearance streams) have their own content streams. Content in appearance streams must also use marked content operators to be accessible; many PDF generators create appearance streams without tagged content.
Tagged content and PDF text extraction
Tagged content is critical for accurate text extraction — including extraction for AI processing, OCR comparison, search indexing, and accessibility.
When software extracts text from a PDF page, it has two approaches: 1. **Content stream order** — Process drawing operators in the sequence they appear in the content stream. Fast but may produce incorrect reading order for complex layouts. 2. **Structure tree order** — Follow the structure tree, using MCIDs to look up the corresponding content on the page. Produces logically ordered text but requires a properly tagged document.
AI processing pipelines (RAG systems, document Q&A tools) that use content stream order extraction are susceptible to column mixing and reading order errors in complex layouts. Documents with correct tagged content — where the structure tree MCIDs are in logical reading order — produce dramatically better extraction results.
This is why the investment in accessible tagged PDFs benefits AI processing as much as screen reader users: the same structural information that makes a document navigable by a screen reader makes it extractable in the correct logical order by an AI pipeline. See <a href="https://pdftheguide.com/news/pdf-and-ai" target="_blank" rel="noopener">our PDF and AI guide</a> for the full story.
Frequently asked questions
What is PDF tagged content?
Tagged content refers to sequences of drawing operators in a PDF page content stream that are bracketed by BDC (Begin Marked Content with Properties) and EMC (End Marked Content) operators. Each tagged sequence has an MCID (Marked Content Identifier) that links it to a structure tree element. This linking is what allows screen readers and other accessibility tools to associate the rendered text and graphics on a page with the document's logical structure.
What is the difference between a tagged PDF and tagged content?
A tagged PDF is a document with both a structure tree (the logical document outline, created once) and tagged content (the marked content operators in each page stream that link the structure to the rendered output). Tagged content is the page-level component; the structure tree is the document-level component. A PDF that has a structure tree but no tagged content in its page streams is not properly tagged — the structure elements have nothing to point to.
Can I add tagged content to an existing untagged PDF?
Yes, but it requires significant work. Adobe Acrobat Pro's "Add Tags to Document" feature automatically adds a structure tree and tagged content operators to an untagged PDF — the quality is reasonable for simple documents but typically requires manual correction for complex layouts. Specialised tools like CommonLook PDF provide more control. For very complex documents, it is often faster to return to the source document (Word, InDesign) and re-export with correct accessibility settings.
Why does my tagged PDF still fail accessibility tests?
Common reasons a nominally tagged PDF fails: (1) tagged content MCIDs are in the wrong order (reading order follows MCID sequence, not visual position); (2) some content is in untagged form (added post-generation without updating the tag tree); (3) structure element types are incorrect (using P tags for headings instead of H1–H6); (4) images in artifact regions lack the /Artifact property tag; (5) form fields are not associated with their label text. Use PAC to identify the specific failing checkpoints.