PDF Annotation
Notes, highlights, shapes, or other markup objects added on top of a PDF page without modifying the underlying content.
A PDF annotation is an object placed on a PDF page that exists as a separate layer above the original page content. Annotations can be notes, highlights, shapes, stamps, links, redaction markers, or any of the other types defined in the PDF specification — all without modifying the underlying content stream of the page.
This separation is the key architectural feature: the original page content is untouched. You can add, modify, or delete annotations freely. When you remove an annotation, the original content beneath it is revealed unchanged. This makes annotations ideal for review, markup, and collaboration workflows where the source document must remain intact.
Annotations are stored as a list of annotation dictionaries in the page's /Annots array. Each annotation has a type, a rectangle defining its position, an appearance stream describing how it looks, and type-specific properties. A viewer renders each annotation's appearance on top of the page when displaying or printing.
The annotation types defined in PDF
The PDF specification defines over 20 annotation subtypes. The most commonly used are:
**Text (sticky note)** — A comment that collapses to a small icon. Clicking the icon opens a pop-up with the comment text. Widely used in document review workflows.
**Link** — A clickable region that navigates to a URL, a page within the document, or another file. Link annotations do not have a visible appearance in most viewers unless you hover over them.
**FreeText** — A text box drawn directly on the page with a visible border and background. Unlike sticky notes, the text is always visible.
**Line, Square, Circle, Polygon, PolyLine** — Geometric shape annotations. Used for marking up diagrams, indicating areas of interest, or drawing attention to specific regions.
**Highlight, Underline, Squiggly, StrikeOut** — Text markup annotations that operate on selected runs of text. These four subtypes are the standard text annotation types for document review.
**Stamp** — A graphical annotation used to mark a document's status — "Approved", "Confidential", "Draft". Stamps can be standard or custom images.
**Ink** — A freehand drawing annotation composed of one or more bezier curve paths. Used for handwritten notes, circles, or freeform markup.
**FileAttachment** — An embedded file attached to a specific location on the page, indicated by a small icon.
**Redact** — A mark indicating content to be removed. When the redaction is applied, the marked content is deleted from the page.
Annotation appearance streams
Every annotation has an appearance stream (the /AP dictionary) that defines exactly how it should be rendered. An appearance stream is a small PDF content stream — the same format used for page content — that draws the annotation's visual representation.
When a viewer renders a page, it draws the page content first, then composites each annotation's appearance stream on top. If an annotation has no appearance stream, the viewer falls back to generating one from the annotation's properties — but this can produce inconsistent results across different viewers.
For interoperability, PDF tools that generate annotations should always include complete appearance streams. This ensures the annotation looks the same in every viewer, even if the viewer has a different default rendering style.
Annotation flags control additional behaviours: whether the annotation is printable, whether it can be selected or edited, whether it is hidden, and whether it should be displayed even if the annotation type is not known to the viewer.
Flattening annotations
Annotations are a separate layer and can be removed or modified by any PDF editor. In some situations, you want to make annotations permanent — merging them into the page content so they behave like original content and cannot be separately edited or removed.
This process is called flattening. When annotations are flattened, each annotation's appearance stream is drawn into the page's content stream, and the annotation object is removed. The result looks identical to the original annotated page, but the annotations are now part of the base content.
Flattening is common before printing (to ensure annotations print exactly as they look on screen), before archiving (PDF/A does not support all annotation types), and before sharing a finalised document where comments should be visible but no longer editable.
Frequently asked questions
What is a PDF annotation?
A PDF annotation is an object — such as a highlight, sticky note, shape, link, or stamp — placed on top of a PDF page as a separate layer. Annotations do not modify the underlying page content; they can be added, moved, edited, or removed without changing the original document.
Do annotations change the original PDF content?
No. Annotations exist in a separate /Annots layer on the page. The original content stream is untouched. You can remove all annotations and the original document is exactly as it was. Flattening is the process that permanently merges annotations into the page content.
Will annotations from one PDF viewer appear in another?
Standard annotation types (highlight, note, shapes, links) are defined in the PDF specification and should be visible in all major viewers. Custom annotation types or annotations without appearance streams may render differently or not at all in some viewers.
Can I print PDF annotations?
Yes, if the annotation has the print flag set. Most standard annotation types (highlights, notes, shapes) are printable by default. Annotations marked as non-printable (like some sticky notes) will display on screen but be omitted from the printed output.
What is the difference between an annotation and an overlay?
In common usage they are often treated as the same thing — both sit above the page content. Technically, annotations are PDF objects defined in the /Annots array with structured properties. An overlay is a looser term for any content placed on top of the page, including text boxes, images, and shapes added by an editor outside the formal annotation system.