All 26 annotation subtypes in PDF 1.7 and the two that PDF 2.0 adds, whether each is a markup annotation, and the entries and flags they share.
An annotation is a dictionary attached to a page. The page’s /Annots array lists them, and each has a /Subtype from the tables below and a /Rect that places it on the page. Annotations are drawn on top of the page’s content stream, not in it, so a reader can show, hide, add or delete them without touching the page itself. Interactive features in Learning shows how they work with actions and forms.
A markup annotation (Yes in the Markup column) is one people use to comment on a document. It can have an author, a pop-up note and replies: the markup entries. A version badge marks a subtype added after PDF 1.0.
Subtypes
Each row lists the subtype’s main entries of its own, besides the common ones, and the table that defines them. PDF 2.0 lists the subtypes in its Table 171.
Notes and comments
| Subtype | What it is for | Markup | Added |
|---|---|---|---|
Text | A “sticky note”: an icon at a point on the page that opens a pop-up window with the note’s text. It keeps its size and orientation when the page is zoomed or rotated. Since PDF 1.5, a text note that replies to another annotation can record a review state such as Accepted. | Yes | |
FreeText | Text written directly on the page and always visible, with no pop-up window. Since PDF 1.6 it can be a callout, with a line pointing at something. | Yes | |
Popup | The pop-up window in which a markup annotation’s text is shown and edited. It never stands alone: the parent annotation points to it with Popup, and it points back with Parent. | No | |
Stamp | Text or graphics made to look as if stamped on the page. Name picks a standard stamp such as Approved, Confidential or Draft (the default). | Yes | |
FileAttachment | An icon tied to a file, usually embedded in the PDF. Opening it lets the user view or save the file. | Yes |
Text markup
The four text markup annotations mark up the text under them and share one set of entries. QuadPoints holds 8 numbers per quadrilateral, one quadrilateral for each word or run of words: see the example. In PDF 1.4 these four were the only “markup annotations”; ISO 32000-1 widened that term to every annotation with Yes in its Markup column.
| Subtype | What it is for | Markup | Added |
|---|---|---|---|
Highlight | Marks text as if with a highlighter pen. | Yes | |
Underline | Underlines text. | Yes | |
Squiggly | Underlines text with a jagged, wavy line. | Yes | |
StrikeOut | Draws a line through text. | Yes |
Edits and redaction
| Subtype | What it is for | Markup | Added |
|---|---|---|---|
Caret | A caret symbol marking a place where the text has been edited. Sy /P adds a paragraph sign. | Yes | |
Redact | Marks content to be removed. Until the redaction is applied it can be reviewed, moved or deleted. Applying it is a separate step: the reader must destroy the content under it, not just cover it, then remove the annotation and draw the overlay in its place. | Yes |
Shapes and drawing
Each of these draws a shape on the page and, like a sticky note, opens a pop-up window with its text. IC is the interior (fill) color; the line width and dash pattern come from a border style dictionary in BS.
| Subtype | What it is for | Markup | Added |
|---|---|---|---|
Line | A straight line between the two points in L. PDF 1.4 added line endings such as arrowheads (LE); PDF 1.6 added leader lines and a caption, for dimension lines. | Yes | |
Square | A rectangle inside the annotation rectangle. Despite the name, its width and height can differ. | Yes | |
Circle | An ellipse inside the annotation rectangle. Despite the name, its width and height can differ. | Yes | |
Polygon | A closed polygon through the points in Vertices. With IT /PolygonCloud it is drawn as a cloud. | Yes | |
PolyLine | Like Polygon, but open: the last point isn’t joined back to the first. | Yes | |
Ink | A freehand scribble: one or more separate paths, each an array of points in InkList. | Yes |
Links and form fields
| Subtype | What it is for | Markup | Added |
|---|---|---|---|
Link | A clickable area that goes to a destination in Dest or runs an action in A, never both. H sets how it looks while clicked. Since PDF 1.6, QuadPoints can narrow the clickable area to a set of quadrilaterals, such as the words of a link that wraps onto a second line. | No | |
Widget | The visible, clickable part of an interactive form field: a text box, check box, button and so on. When a field has several widgets, each points to it with Parent; a field with only one widget can share a single dictionary with it. | No |
Multimedia and 3D
| Subtype | What it is for | Markup | Added |
|---|---|---|---|
Sound | Like a sticky note, but holding a sound recording instead of text, played when the annotation is activated. | Yes | |
Movie | Plays a movie inside the annotation rectangle. Here A is not an action: it is true, false or a dictionary saying how to play the movie. | No | |
Screen | An area of the page where media clips play, started and stopped by rendition actions. It can also run actions of its own. | No | |
3D | 3D artwork on the page. 3DD holds the 3D stream, and 3DV the view to show first. Defined with the rest of 3D artwork in §13.6 of ISO 32000-1. | No | |
RichMedia | Video, audio, animation or interactive 3D, in one framework with settings for when it is activated and deactivated. RichMediaExecute actions send commands to it. | No | |
Projection | A markup annotation that only makes sense alongside a running environment such as an activated 3D model. It keeps 3D measurements and comments in the document. It has no entries of its own beyond the common and markup ones. | Yes |
Printing and production
| Subtype | What it is for | Markup | Added |
|---|---|---|---|
PrinterMark | A mark for print production, such as a registration target, color bar or cut mark. MN names the kind of mark. | No | |
TrapNet | The trapping for a page: marks along color boundaries that hide gaps when the printing plates don’t line up exactly. A page has at most one, and it must be the last entry in /Annots. | No | |
Watermark | Graphics printed at a fixed size and position on the paper, whatever the paper size. It has no pop-up window and no interaction. | No |
Entries in every annotation
Any annotation dictionary can have these, whatever its subtype. Only Subtype and Rect are required.
| Key | Type | Value | Added |
|---|---|---|---|
Type | name | /Annot, if present. | |
Subtype | name | Required. Which kind of annotation this is: one of the subtypes on this page. | |
Rect | rectangle | Required. Where the annotation is on the page, in default user space: [llx lly urx ury]. | |
Contents | text string | The text the annotation displays or, for one that displays none, a description of it for accessibility and text extraction. In PDF 1.4 some subtypes require it. | |
P | dictionary | The page the annotation is on. Required for a screen annotation used by rendition actions. | |
NM | text string | A name for the annotation, unique among the annotations on its page. | |
M | date or text string | When the annotation was last modified, preferably as a PDF date string. | |
F | integer | The annotation flags. Default 0. | |
AP | dictionary | The appearance dictionary: how the annotation is drawn. PDF 2.0 requires it on every annotation except Popup, Link and Projection annotations and those whose Rect has zero width and height. | |
AS | name | The appearance state, which picks one appearance out of a subdictionary in AP. Required when AP has subdictionaries. | |
Border | array | The border: [hRadius vRadius width], plus (PDF 1.1) a dash array. Default [0 0 1], a solid 1-unit border; width 0 means none. Subtypes that take a border style dictionary (BS) ignore it when BS is present. | |
C | array | A color for the icon’s background when closed, the pop-up’s title bar and a link’s border. In PDF 1.4 it is always three RGB numbers. ISO 32000-1 lets the number of components pick the color space: 0 for transparent, 1 for gray, 3 for RGB, 4 for CMYK. | |
StructParent | integer | The annotation’s key in the structure parent tree, required when it is part of the document’s logical structure. | |
OC | dictionary | An optional content group or membership dictionary. When that content is turned off, the annotation is skipped as if it weren’t there. |
- PDF 1.4’s table is longer. It also lists
T,PopupandCA, which ISO 32000-1 moved to the markup entries, andA,AAandBS, which it moved to the subtypes that use them:Ato Link, Screen and Widget,AAto Screen and Widget. - PDF 2.0 adds four more (ISO 32000-2 Table 166):
AFfor associated files,cafor the fill opacity to use when regenerating the appearance,BMfor the blend mode used to paint the annotation onto the page, andLangfor its language. It also makesCAavailable to every annotation, not just markup annotations.
Entries in markup annotations
ISO 32000-1 gives these to every subtype with Yes in the Markup column. Together they turn annotations into a comment thread: who wrote each one, when, and what it replies to. In PDF 1.4, T, Popup and CA were common to all annotations and the rest didn’t exist yet.
| Key | Type | Value | Added |
|---|---|---|---|
T | text string | The text for the pop-up window’s title bar, which names the person who added the annotation. | |
Popup | dictionary | The Popup annotation used to show and edit this one’s text. | |
CA | number | The opacity of the closed annotation, 0.0 to 1.0. Default 1.0. In PDF 1.4 it also applies when the appearance stream is painted; ISO 32000-1 ignores it when there is an appearance stream, which must then set any transparency itself. | |
RC | text string or stream | A rich text string (formatted text) to show in the pop-up window. | |
CreationDate | date | When the annotation was created. | |
IRT | dictionary | “In reply to”: the annotation this one replies to, on the same page. Required when RT is present. | |
Subj | text string | A short description of the subject of the annotation. | |
RT | name | How this annotation relates to the one in IRT: /R, a reply (the default), or /Group, grouped with it so the two act as one. | |
IT | name | The intent: a more specific use of the subtype, such as /FreeTextCallout, /LineArrow or /PolygonCloud. | |
ExData | dictionary | External data the annotation is tied to. The only subtype ISO 32000-1 defines is /Markup3D, for comments on 3D views. |
A reply is another markup annotation whose IRT points at the original. Since PDF 1.5 a reply can also record a reviewer’s decision: a Text annotation in reply sets StateModel to Marked or Review and State to a state of that model, such as Accepted, Rejected or Completed (1.7 Table 171).
Annotation flags
/F is an integer whose bits each switch one behavior on. Bit 1 is the lowest; add up the values of the bits you want. /F 4 sets only Print. /F 36 (4 + 32) sets Print and NoView: the annotation prints but doesn’t show on screen. Bits not listed must be 0.
| Bit (value) | Name | Meaning | Added |
|---|---|---|---|
| 1 (1) | Invisible | Matters only for a subtype the reader doesn’t know. If set, don’t show it; if clear, show it with its appearance stream, if any. | |
| 2 (2) | Hidden | Don’t show it, print it or let the user interact with it, whatever its subtype. | |
| 3 (4) | Print it when the page is printed. If clear, it never prints, even when it shows on screen. | ||
| 4 (8) | NoZoom | Don’t scale its appearance when the page is zoomed. Its upper-left corner stays put. | |
| 5 (16) | NoRotate | Don’t rotate its appearance with the page’s /Rotate. It pivots around its upper-left corner instead. | |
| 6 (32) | NoView | Don’t show it on screen or let the user interact with it. It can still print, depending on Print. | |
| 7 (64) | ReadOnly | Show and print it, but don’t let the user interact with it. Ignored for widget annotations, where the form field’s own ReadOnly flag applies. | |
| 8 (128) | Locked | Don’t let the user delete it or change its properties, such as its position and size. Its contents, such as a form field’s value, can still change. | |
| 9 (256) | ToggleNoView | Flip the meaning of NoView for certain events: for example, an annotation that shows only while the pointer is over it. | |
| 10 (512) | LockedContents | Don’t let the user change its contents. It can still be moved, resized or deleted. |
NoZoom and NoRotate keep the annotation’s upper-left corner where /Rect puts it in default user space and leave /Rect itself unchanged; the reader moves the other three corners. A Text annotation behaves as if both were always set.
Appearance streams
/AP (PDF 1.2) says exactly how to draw the annotation. Each appearance is a form XObject: a self-contained content stream using the same operators as a page. The reader takes the form’s /BBox, transforms it by the form’s /Matrix, and scales and moves the result to fill /Rect.
| Key | Appearance |
|---|---|
N | Required. The normal appearance, used whenever the user isn’t interacting with the annotation, and for printing. |
R | The rollover appearance, while the pointer is over the annotation. Defaults to N. |
D | The down appearance, while the mouse button is held down on it. Defaults to N. |
Each value is either one stream or a dictionary of streams, one per appearance state, and the annotation’s /AS names the state to draw. A check box widget, for example, has an “on” state, which should be named /Yes, and /Off. Clicking it switches /AS:
/AP << /N << /Yes 20 0 R /Off 21 0 R >> % checked and unchecked
/D << /Yes 22 0 R /Off 23 0 R >> >> % the same, while pressed
/AS /Yes- A reader that doesn’t support a subtype still draws its
Nappearance, if it has one. - Since PDF 1.4 an appearance can use transparency. It is composited over the page’s content and any annotations drawn before it.
- Without
/AP, each reader draws the annotation its own way from entries such asQuadPointsandC, and results vary. PDF 2.0 requires/APon nearly every annotation (see AP above).
Example
A page with two annotations: a link to a web page, and a highlight with its appearance stream.
3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources 5 0 R /Annots [10 0 R 11 0 R] >> endobj 10 0 obj % a link to a web page << /Type /Annot /Subtype /Link /Rect [72 640 230 654] /Border [0 0 0] /A << /S /URI /URI (https://example.com/) >> >> endobj 11 0 obj % a highlight over one line of text << /Type /Annot /Subtype /Highlight /Rect [72 700 180 714] /QuadPoints [72 700 180 700 180 714 72 714] /C [1 1 0] /T (Reviewer) /Contents (Check this figure.) /F 4 /AP << /N 12 0 R >> >> endobj 12 0 obj % its appearance: a yellow box, multiplied into the text << /Type /XObject /Subtype /Form /BBox [72 700 180 714] /Resources << /ExtGState << /GS0 << /BM /Multiply >> >> >> /Length 35 >> stream /GS0 gs 1 1 0 rg 72 700 108 14 re f endstream endobj
- The link has a zero-width
/Border, so no box is drawn around it. Its/Ais a URI action; for a jump inside the document it would use/Destor a GoTo action. In PDF 2.0, links are one of the few annotations that may leave out/AP. - The highlight’s
/QuadPointsgive the four corners of the highlighted line counterclockwise from the lower left, the order the specification describes, with the text running along the edge from the first corner to the second. Not every writer follows that order, so readers tend to accept others. /F 4sets the Print flag,/Cis yellow (used for the pop-up’s title bar too), and/Tand/Contentsare the author and the note shown in the pop-up.- The appearance fills a yellow rectangle with the Multiply blend mode, so the black text underneath stays visible. Its
/BBoxequals the annotation’s/Rect, so the reader draws it without scaling.
Checked against §8.4 of the Adobe PDF Reference, third edition (PDF 1.4), Tables 8.10, 8.11, 8.13 and 8.14 and the subtype tables after them; §12.5 of ISO 32000-1:2008 (PDF 1.7), Tables 164, 165, 168, 169, 170 and 171 and the subtype tables after them; and ISO 32000-2:2020 (PDF 2.0), Tables 166 and 171, for what PDF 2.0 adds and deprecates.