Reference Interactive

Annotation types

1.4 §8.41.7 §12.5

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.

PDF 1.4 has 19 subtypes; PDF 1.7 has 26. PDF 1.5 added Polygon, PolyLine, Caret and Screen, PDF 1.6 Watermark and 3D, and PDF 1.7 Redact. PDF 2.0 adds Projection and RichMedia and deprecates Sound, Movie and TrapNet.

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

1.4 Table 8.141.7 Table 169

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

SubtypeWhat it is forMarkupAdded
TextA “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.Entries: Open, Name, State, StateModel1.4 Table 8.15 · 1.7 Table 172Yes
FreeTextText 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.Entries: DA, Q, RC, DS, CL, IT1.4 Table 8.17 · 1.7 Table 174YesPDF 1.3
PopupThe 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.Entries: Parent, Open1.4 Table 8.24 · 1.7 Table 183NoPDF 1.3
StampText or graphics made to look as if stamped on the page. Name picks a standard stamp such as Approved, Confidential or Draft (the default).Entries: Name1.4 Table 8.22 · 1.7 Table 181YesPDF 1.3
FileAttachmentAn icon tied to a file, usually embedded in the PDF. Opening it lets the user view or save the file.Entries: FS, Name1.4 Table 8.25 · 1.7 Table 184YesPDF 1.3

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.

SubtypeWhat it is forMarkupAdded
HighlightMarks text as if with a highlighter pen.Entries: QuadPoints1.4 Table 8.21 · 1.7 Table 179YesPDF 1.3
UnderlineUnderlines text.Entries: QuadPoints1.4 Table 8.21 · 1.7 Table 179YesPDF 1.3
SquigglyUnderlines text with a jagged, wavy line.Entries: QuadPoints1.4 Table 8.21 · 1.7 Table 179YesPDF 1.4
StrikeOutDraws a line through text.Entries: QuadPoints1.4 Table 8.21 · 1.7 Table 179YesPDF 1.3

Edits and redaction

SubtypeWhat it is forMarkupAdded
CaretA caret symbol marking a place where the text has been edited. Sy /P adds a paragraph sign.Entries: Sy, RD1.7 Table 180YesPDF 1.5
RedactMarks 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.Entries: QuadPoints, IC, RO, OverlayText, Repeat1.7 Table 192YesPDF 1.7

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.

SubtypeWhat it is forMarkupAdded
LineA 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.Entries: L, LE, IC, LL, Cap, IT1.4 Table 8.18 · 1.7 Table 175YesPDF 1.3
SquareA rectangle inside the annotation rectangle. Despite the name, its width and height can differ.Entries: IC, BS, BE, RD1.4 Table 8.20 · 1.7 Table 177YesPDF 1.3
CircleAn ellipse inside the annotation rectangle. Despite the name, its width and height can differ.Entries: IC, BS, BE, RD1.4 Table 8.20 · 1.7 Table 177YesPDF 1.3
PolygonA closed polygon through the points in Vertices. With IT /PolygonCloud it is drawn as a cloud.Entries: Vertices, IC, BE, IT1.7 Table 178YesPDF 1.5
PolyLineLike Polygon, but open: the last point isn’t joined back to the first.Entries: Vertices, LE, IT1.7 Table 178YesPDF 1.5
InkA freehand scribble: one or more separate paths, each an array of points in InkList.Entries: InkList, BS1.4 Table 8.23 · 1.7 Table 182YesPDF 1.3
SubtypeWhat it is forMarkupAdded
WidgetThe 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.Entries: MK, H, A, AA, Parent1.4 Table 8.28 · 1.7 Table 188NoPDF 1.2

Multimedia and 3D

SubtypeWhat it is forMarkupAdded
SoundLike a sticky note, but holding a sound recording instead of text, played when the annotation is activated.Deprecated in PDF 2.0Entries: Sound, Name1.4 Table 8.26 · 1.7 Table 185YesPDF 1.2
MoviePlays 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.Deprecated in PDF 2.0Entries: Movie, A, T1.4 Table 8.27 · 1.7 Table 186NoPDF 1.2
ScreenAn area of the page where media clips play, started and stopped by rendition actions. It can also run actions of its own.Entries: MK, A, AA, T1.7 Table 187NoPDF 1.5
3D3D 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.Entries: 3DD, 3DV, 3DA1.7 Table 298NoPDF 1.6
RichMediaVideo, audio, animation or interactive 3D, in one framework with settings for when it is activated and deactivated. RichMediaExecute actions send commands to it.Entries: RichMediaContent, RichMediaSettings2.0 Table 333NoPDF 2.0
ProjectionA 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.Entries: ExData2.0 §12.5.6.24YesPDF 2.0

Printing and production

SubtypeWhat it is forMarkupAdded
PrinterMarkA mark for print production, such as a registration target, color bar or cut mark. MN names the kind of mark.Entries: MN1.4 Table 9.43 · 1.7 Table 362NoPDF 1.4
TrapNetThe 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.Deprecated in PDF 2.0Entries: LastModified, Version, AnnotStates1.4 Table 9.47 · 1.7 Table 366NoPDF 1.3
WatermarkGraphics printed at a fixed size and position on the paper, whatever the paper size. It has no pop-up window and no interaction.Entries: FixedPrint1.7 Table 190NoPDF 1.6

Entries in every annotation

1.4 Table 8.101.7 Table 164

Any annotation dictionary can have these, whatever its subtype. Only Subtype and Rect are required.

KeyTypeValueAdded
Typename/Annot, if present.
SubtypenameRequired. Which kind of annotation this is: one of the subtypes on this page.
RectrectangleRequired. Where the annotation is on the page, in default user space: [llx lly urx ury].
Contentstext stringThe 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.
PdictionaryThe page the annotation is on. Required for a screen annotation used by rendition actions.PDF 1.3
NMtext stringA name for the annotation, unique among the annotations on its page.PDF 1.4
Mdate or text stringWhen the annotation was last modified, preferably as a PDF date string.PDF 1.1
FintegerThe annotation flags. Default 0.PDF 1.1
APdictionaryThe 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.PDF 1.2
ASnameThe appearance state, which picks one appearance out of a subdictionary in AP. Required when AP has subdictionaries.PDF 1.2
BorderarrayThe 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.
CarrayA 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.PDF 1.1
StructParentintegerThe annotation’s key in the structure parent tree, required when it is part of the document’s logical structure.PDF 1.3
OCdictionaryAn optional content group or membership dictionary. When that content is turned off, the annotation is skipped as if it weren’t there.PDF 1.5
  • PDF 1.4’s table is longer. It also lists T, Popup and CA, which ISO 32000-1 moved to the markup entries, and A, AA and BS, which it moved to the subtypes that use them: A to Link, Screen and Widget, AA to Screen and Widget.
  • PDF 2.0 adds four more (ISO 32000-2 Table 166): AF for associated files, ca for the fill opacity to use when regenerating the appearance, BM for the blend mode used to paint the annotation onto the page, and Lang for its language. It also makes CA available to every annotation, not just markup annotations.

Entries in markup annotations

1.4 Table 8.101.7 Table 170

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.

KeyTypeValueAdded
Ttext stringThe text for the pop-up window’s title bar, which names the person who added the annotation.PDF 1.1
PopupdictionaryThe Popup annotation used to show and edit this one’s text.PDF 1.3
CAnumberThe 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.PDF 1.4
RCtext string or streamA rich text string (formatted text) to show in the pop-up window.PDF 1.5
CreationDatedateWhen the annotation was created.PDF 1.5
IRTdictionary“In reply to”: the annotation this one replies to, on the same page. Required when RT is present.PDF 1.5
Subjtext stringA short description of the subject of the annotation.PDF 1.5
RTnameHow this annotation relates to the one in IRT: /R, a reply (the default), or /Group, grouped with it so the two act as one.PDF 1.6
ITnameThe intent: a more specific use of the subtype, such as /FreeTextCallout, /LineArrow or /PolygonCloud.PDF 1.6
ExDatadictionaryExternal data the annotation is tied to. The only subtype ISO 32000-1 defines is /Markup3D, for comments on 3D views.PDF 1.7

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

1.4 Table 8.111.7 Table 165

/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)NameMeaningAdded
1 (1)InvisibleMatters 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)HiddenDon’t show it, print it or let the user interact with it, whatever its subtype.PDF 1.2
3 (4)PrintPrint it when the page is printed. If clear, it never prints, even when it shows on screen.PDF 1.2
4 (8)NoZoomDon’t scale its appearance when the page is zoomed. Its upper-left corner stays put.PDF 1.3
5 (16)NoRotateDon’t rotate its appearance with the page’s /Rotate. It pivots around its upper-left corner instead.PDF 1.3
6 (32)NoViewDon’t show it on screen or let the user interact with it. It can still print, depending on Print.PDF 1.3
7 (64)ReadOnlyShow 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.PDF 1.3
8 (128)LockedDon’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.ISO 32000-1 marks Locked as PDF 1.4, but the PDF 1.4 reference’s Table 8.11 stops at bit 7.PDF 1.4
9 (256)ToggleNoViewFlip the meaning of NoView for certain events: for example, an annotation that shows only while the pointer is over it.PDF 1.5
10 (512)LockedContentsDon’t let the user change its contents. It can still be moved, resized or deleted.PDF 1.7

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

1.4 §8.4.41.7 §12.5.5

/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.

KeyAppearance
NRequired. The normal appearance, used whenever the user isn’t interacting with the annotation, and for printing.
RThe rollover appearance, while the pointer is over the annotation. Defaults to N.
DThe down appearance, while the mouse button is held down on it. Defaults to N.

1.4 Table 8.131.7 Table 168

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 N appearance, 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 as QuadPoints and C, and results vary. PDF 2.0 requires /AP on 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 /A is a URI action; for a jump inside the document it would use /Dest or a GoTo action. In PDF 2.0, links are one of the few annotations that may leave out /AP.
  • The highlight’s /QuadPoints give 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 4 sets the Print flag, /C is yellow (used for the pop-up’s title bar too), and /T and /Contents are 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 /BBox equals the annotation’s /Rect, so the reader draws it without scaling.

1.4 Table 8.211.7 Table 179

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.

Section references such as 1.4 §3.4 1.7 §7.5 are to the Adobe PDF Reference, third edition (PDF 1.4) and ISO 32000-1:2008 (PDF 1.7). Where to get them: PDF specifications.