Adobe PDF Library 21 is now available! Get your free trial of 21 today
Developer Resources

Marked Content in PDF: The Quiet Feature Behind Accessible, Structured and Layered Documents

#PDF Manipulation #PDF Optimization #Workflow Integration
Published November 14, 2021 Updated November 30, 2026

Since June 1993, PDF has provided a rich and powerful format for portable document creation. From the moment PDF was introduced, until the PDF format was made into an open, worldwide standard by ISO in 2008 – the growth in PDF's features and capabilities in its first fifteen years was rapid and revolutionary. The past decade of relative stability has allowed the use of PDF and the availability of different PDF tools to proliferate.

Others have looked back on the history and ubiquity of PDF. The Register and Motherboard have spent some good letters and pixels on the history of PDF. Much has been said about the fundamentals and foundations of PDF as a page description language. But PDF is so much more than just markings on a page.

Let's take a look at an underappreciated but foundational capability in PDF files: marked content. It rarely gets a headline, but it quietly powers accessibility, content extraction, document layers and more. And if you build software that creates or processes PDFs, it's a capability you can put to work.

Exploring Marked Content

What is marked content?

At its simplest, marked content allows a series of drawing operations to be grouped together into a collection. For example, the words of a sentence or the lines that make a shape can be thought of as a single collection of content. These collections are denoted in PDF with marked content sequences.

Marked content sequences have been a part of PDF for much of its lifetime. Introduced with PDF 1.2 in 1996, marked content was added to support allowing Acrobat plugins to associate proprietary information with portions of pages. This represented the beginnings of adding structure to the page description model which PDF was founded on.

Marked content is very simply represented in PDF files. At its simplest, a specific point in a page content stream may be marked with a simple tag with the MP operator. Likewise, a collection of drawing operators may be bracketed in a set of BMC (Begin Marked Content) and EMC (End Marked Content) operators to group the content, with a tag to denote the role or significance of the marked content, like so:

text
/Collection_1 BMC
  % PDF content stream operators: text or path drawing operations
  % to collect up into one entity
EMC

More useful is the ability to associate a collection of information to page content in the form of property lists, with the DP operator (to mark a specific point in page content) or BDC operator (to start a section of marked content, terminated by a corresponding EMC operator) used in conjunction with a list of properties and references to other objects in the PDF file.

Very quickly, many people saw the potential in being able to group page drawing elements together. Within the PDF standard and within applications, marked content enabled key capabilities:

Element Grouping

Grouping drawing elements together to be worked with as a collection. Without marked content, line art can only be represented with its constituent drawing operations: lines, paths, and very simple shapes. Marked content allows grouping these together to form more complex line art, such as charts and graphs. With marked content, charts and graphs and other image items can be moved, copied, and otherwise manipulated as one item – instead of requiring users to tediously select the multiple pieces that make these up in a PDF file.

Logical Structure

Describing the logical structure of PDF content. Without marked content, PDF page content can only represent visual elements. Logical structure came into PDF in 1999 with Reader & Acrobat 4.0 and PDF 1.3. With support for properties and property lists, marked content forms the foundation for grouping visual page parts by the document concepts these represent. Because marked content containers are nestable, hierarchical concepts such as chapters in a document can be created. And because logical structure and page drawing content are stored separately in a PDF, users who are interested in the logical structure of a PDF are not required to parse the graphical elements of pages in order to understand the structure.

Tagged PDF

Standardizing semantic content representation. Marked content and logical structure were brought together in PDF 1.4 in 2001, and a standard set of structure tags created, to form what is known as Tagged PDF. Tagged PDF and its Standard Structure Tags (SSTs) extend the abilities to group and mark up page content into a portable, interoperable series of document semantic concepts. Complex PDF content spanning dozens or hundreds of different image and text operations – such as tables – now has a way to be specified, exported, and re-imported into different applications, as well as transcoded into different formats.

Tagged PDF forms the foundation of concept – not just graphical content – interoperability, and conversion. From the foundation of marked content sequences, tagged PDF sets the basis for many PDF capabilities, including:

  • Content accessibility for screen readers and text to speech applications
  • Content extraction for automated content ingestion, in applications such as neuro-linguistic processing (NLP)
  • Content transformation for non-layout markup languages such as XML

Optional Content

The ability of PDF to have different layers and layer groups is built on the marked content facility. Using marked content operators to group portions of page content, and using PDF arrays and dictionaries to make collections of these, PDF allows users to make entire sets of content where these can be displayed or hidden all together as one. Layers are a powerful application of marked content and other PDF features, and have several common uses:

  • Allowing the inclusion of multiple languages of text in one PDF document. Users can toggle between different languages to match their preference.
  • Collecting multiple components of a drawing into one PDF file and controlling the view of these. In files such as architectural drawings, different elements such as wiring, plumbing, HVAC and structural components can all be included – and their display activated and inactivated individually – as needed by different viewers.

Why Marked Content Matters for Your Workflows

It's easy to treat all of this as PDF trivia. It isn't. Marked content and Tagged PDF are the reason a lot of real-world requirements can be met at all:

  • Accessibility compliance. Tagged structure is what lets screen readers and text-to-speech tools make sense of a page. It's also a requirement for standards such as PDF/UA and for the PDF/A-1a conformance level, so if your customers need accessible or archival documents, tagging isn't optional.
  • Reliable text extraction. Pipelines that feed documents into search, analytics or NLP are far more dependable when the PDF carries its own structure, instead of leaving software to guess where paragraphs, headings and tables begin and end.
  • Data transformation. Structure is what makes it practical to move content from PDF into XML and other non-layout formats without losing its meaning.
  • Layered, multi-audience documents. Optional content lets you ship one file that serves several languages, several trades, or several audiences, each seeing only what they need.

The catch is that none of this happens by accident. Someone, or something, has to create the marked content, build the structure tree and connect the two correctly. That is where the right toolkit makes the difference.

Putting Marked Content to Work with Adobe PDF Library

The Adobe PDF Library (APDFL) is built for developers who need to work with PDF at this level: directly with page content, structure and annotations, rather than through a layer of abstraction. That means you can do more than read PDFs and tweak them. You can generate them, with structure built in from the first page.

If that sounds abstract, here's a concrete example.

See It in Code: Generating a Tagged PDF from Markdown

Our MarkdownToPDF sample is a C#/.NET console program that takes a Markdown file and produces a brand new, tagged PDF, using APDFL on its own. There is no conversion to HTML, no headless browser and no separate PDF rendering library. Everything in the pipeline is done with APDFL:

  • Layout: measuring and wrapping text, and paginating content across pages
  • Drawing: headings, paragraphs, lists, tables, code blocks and blockquotes
  • Tagging: marked content, marked content IDs (MCIDs), a parent tree and a full structure tree, so the output is meaningful as well as good-looking
  • Links: clickable link annotations connected to the structure
  • Fonts: font embedding for reliable output, with fallback fonts and script-aware wrapping for CJK, Cyrillic and Greek text

In other words, every concept in this post (marked content sequences, logical structure and Tagged PDF) is working together in understandable code. If you've ever wondered what building a tagged PDF involves in practice, it's a good place to start. The sample is structured so each responsibility (parsing, layout, tagging and font handling) lives in its own class, which makes it easy to read and easy to extend.

Want to try it? Once you have the .NET SDK and an APDFL license (a trial works), it's only a few commands:

powershell
dotnet restore
dotnet build
dotnet run

Running it with no arguments converts the included sample.md to output.pdf. From there you can switch page sizes, orientation, fonts and languages from the command line, or convert a whole folder of Markdown files in one go.

It's also a useful template for a broader idea: if your content already lives in a structured or semi-structured form, you may be able to turn it into accessible, well-formed PDF output without leaning on any extra rendering technology. Think reports, statements, documentation and other generated documents.

Ready to Get Started?

From humble beginnings as a means to allow Acrobat plugins to store their own private information in PDF files, content grouping via marked content has provided the basis for many useful capabilities in PDF. We hope you've enjoyed this brief look at marked content, and at the capabilities in PDF that build on the simple but powerful concept of grouping visual elements together into common structures.

If you'd like to see what it can do for your own documents:

  • Get hands-on. Request a free trial of Adobe PDF Library and run the MarkdownToPDF sample, along with the rest of our C++, Java and C# samples, in your own environment. You can browse the code first in the MarkdownToPDF sample on GitHub.
  • Talk to an engineer. Have a specific accessibility, extraction or document generation challenge? Set up a meeting with one of our software engineers. We're happy to talk through your requirements and help you figure out the best approach.