Skip to main content

Annotation types

ARender stores and exchanges annotations in XFDF format, following the Adobe XFDF specification. Each annotation type maps to a Java class in the annotation-api module and to a specific XFDF element name.

For the REST endpoints used to read and write annotations, see the Broker API.

Common properties

Every annotation, regardless of type, carries the following base properties:

PropertyTypeDescription
idstringUnique annotation identifier
documentIdstringID of the document the annotation belongs to
pageinteger0-based page number
positionobjectBounding rectangle: {x, y, w, h} in page-relative coordinates
colorobjectAnnotation color: {r, g, b}
opacityfloatOpacity between 0.0 and 1.0
creatorstringUser who created the annotation
lastModifierstringUser who last modified the annotation
dateISO 8601 stringLast modification date
creationDateISO 8601 stringCreation date
subjectstringAnnotation subject label
contentsstringPlain text content
contentsRichtextobjectRich text content (HTML)
flagsobjectBehavior flags: {hidden, readonly, locked, print}
securitystringSecurity level symbolic name (when security is enabled)

Most text-bearing annotation types also support:

  • popup: A floating comment window (PopupElemType)
  • inreplyto: Reference to another annotation ID (for replies)
  • state / statemodel: Annotation status markers (e.g., Accepted, Rejected, Cancelled, Completed, None under the Review model)

Text (sticky note)

XFDF element: <text>

A sticky note anchored to a point on the page. The icon marks the anchor. The popup window displays the comment text.

Specific properties:

PropertyTypeDefaultDescription
iconstringNoteAnchor icon. See icon values below
inreplytostringID of the annotation this is a reply to
statestringStatus value (e.g., Accepted, Rejected)
statemodelstringState model. Currently: Review
calloutfloat arrayCallout line point coordinates

Icon values: Comment, Check, Circle, Cross, Help, Insert, Key, NewParagraph, Note, Paragraph, RightArrow, RightPointer, Star, UpArrow, UpLeftArrow

XFDF example:

<text page="0" rect="100,200,120,220" color="#FFD700"
icon="Note" creator="alice" date="D:20260317120000">
<popup open="no"/>
<contents>This section needs review.</contents>
</text>

Highlight

XFDF element: <highlight>

Marks a region of text with a transparent color overlay. The coords attribute specifies the four corner points of each highlighted text span.

Specific properties:

PropertyTypeRequiredDescription
coordsfloat arrayyesList of quad-point coordinates for each highlighted span

XFDF example:

<highlight page="0" rect="50,100,300,115" color="#FFFF00"
coords="50,115,300,115,50,100,300,100"
creator="bob">
<contents>Key term</contents>
</highlight>

Strikeout

XFDF element: <strikeout>

Draws a line through a text span, indicating deletion or rejection. Uses the same coords attribute as highlight.

Specific properties:

PropertyTypeRequiredDescription
coordsfloat arrayyesQuad-point coordinates of each struck-out span

Underline

XFDF element: <underline>

Draws a line below a text span. Uses the same coords attribute as highlight and strikeout.

Specific properties:

PropertyTypeRequiredDescription
coordsfloat arrayyesQuad-point coordinates of each underlined span

Free text

XFDF element: <freetext>

Displays text directly on the page inside a rectangle, with configurable font, border, and rotation.

Specific properties:

PropertyTypeDescription
defaultappearancestringPDF appearance string specifying font and size (required)
defaultstylestringCSS-like style override
rotationintegerRotation in degrees (0, 90, 180, 270)
justificationstringText alignment: left, center, right
calloutfloat arrayThree-point callout line: elbow and tip coordinates
widthfloatBorder width
stylestringBorder style: S (solid), D (dashed), B (beveled), I (inset), U (underline)
dashesfloat arrayDash pattern when style=D

XFDF example:

<freetext page="0" rect="50,400,200,430" color="#000000"
rotation="0" justification="left">
<defaultappearance>/Helvetica 12 Tf 0 0 0 rg</defaultappearance>
<contents>Approved by legal.</contents>
</freetext>

Stamp

XFDF element: <stamp>

Places a rubber-stamp image or text label on the page.

Specific properties:

PropertyTypeDefaultDescription
iconstringDraftPredefined stamp icon name, or a custom text label
rotationintegerRotation in degrees
appearancestringCustom appearance stream for image stamps

Stamp annotations are also used for watermarks when delivered through the waterMarkTemplates section of the annotation template catalog.

XFDF example:

<stamp page="0" rect="100,500,250,560" color="#FF0000"
icon="Approved" rotation="350" creator="manager">
</stamp>

Image stamp

XFDF element: <stamp> (subtype ImageStamp)

A variant of Stamp that embeds a raster image. The image data is encoded in the appearance field.


Line

XFDF element: <line>

Draws a straight line between two points, with optional arrow heads.

Specific properties:

PropertyTypeRequiredDescription
startpointyesStart point as x,y
endpointyesEnd point as x,y
headstringEnd-cap style at the end point
tailstringEnd-cap style at the start point
interiorColorcolorFill color for solid end caps
widthfloatLine stroke width
stylestringBorder style
dashesfloat arrayDash pattern

End-cap values: None, Square, Circle, Diamond, OpenArrow, ClosedArrow, Butt, ROpenArrow, RClosedArrow, Slash

XFDF example:

<line page="0" rect="50,50,200,100" color="#FF0000"
start="50,75" end="200,75"
head="OpenArrow" tail="None" width="2">
</line>

Square

XFDF element: <square>

Draws a rectangle (not necessarily a square).

Specific properties:

PropertyTypeDescription
interiorColorcolorFill color
widthfloatBorder width
stylestringBorder style
dashesfloat arrayDash pattern

Circle

XFDF element: <circle>

Draws an ellipse inscribed within the annotation bounding rectangle.

Specific properties:

PropertyTypeDescription
interiorColorcolorFill color
widthfloatBorder width
stylestringBorder style
dashesfloat arrayDash pattern

Polygon

XFDF element: <polygon>

Draws a closed polygon from a sequence of vertices. The last vertex is connected back to the first.

Specific properties:

PropertyTypeRequiredDescription
verticesfloat arrayyesFlat list of x,y pairs
interiorColorcolorFill color
widthfloatBorder width
stylestringBorder style

Polyline

XFDF element: <polyline>

Draws an open multi-segment line through a sequence of vertices.

Specific properties:

PropertyTypeRequiredDescription
verticesfloat arrayyesFlat list of x,y pairs
headstringEnd-cap style at the last vertex
tailstringEnd-cap style at the first vertex
widthfloatStroke width

Ink

XFDF element: <ink>

Records freehand drawing as one or more paths. Each path is a sequence of points captured from pointer input.

Specific properties:

PropertyTypeRequiredDescription
inklistlist of pathsyesOne or more strokes, each a list of x,y pairs
widthfloatStroke width
stylestringStroke style
dashesfloat arrayDash pattern

XFDF example:

<ink page="0" rect="50,50,300,200" color="#0000FF" width="2">
<inklist>
<gesture>100,150;120,130;140,150;160,130</gesture>
<gesture>100,170;150,170;200,170</gesture>
</inklist>
</ink>

Redact

XFDF element: <redact>

Marks an area for redaction. When the document is burned (via the transformation API), the marked area is replaced with an opaque fill, and the underlying text is removed by default.

Specific properties:

PropertyTypeDescription
coordsfloat arrayQuad-point coordinates of text spans to redact (optional, for text-aligned redactions)
interiorColorcolorFill color of the redaction box (applied after burn)
overlayTextstringReplacement text shown after burn
overlayTextRepeatbooleanTile the overlay text across the redacted area
justificationstringAlignment of the overlay text

Redact annotations are two-phase: they appear as colored overlays before burn, and become permanent after the transformation.

note

The redact.deleteText broker property controls whether the underlying PDF text is deleted during burn. The default is true.


Redact text

XFDF element: <redact> (subtype RedactText)

A variant of Redact that targets a text span rather than an area. It is created automatically when using annotation creation rules that search and mark text for redaction across pages.


Rotation

XFDF element: <rotation> (ARender extension)

Encodes a page rotation instruction. This type is used internally by the document builder to record page rotations in a document assembly workflow.


XFDF element: <link>

Represents a hyperlink area on the page. Links are read from the document and stored alongside user-created annotations. They are typically not created by end users directly.


Bookmark

XFDF element: <bookmark>

Represents a document outline entry. Like Link, bookmarks come from the document structure and are stored in the annotation layer for access through the API.


Not implemented

The following XFDF types have class representations in the annotation API but are not supported in the viewer UI for creation or editing:

TypeNotes
CaretDefined but not available in the UI
File attachmentDefined but not available in the UI
SoundDefined but not available in the UI
Form fieldsRead-only via FieldElemType, not creatable

Annotation creation policy

The annotation creation policy controls what a user can do with annotations on a given document. It is returned by GET /annotation/policy?documentId={documentId}.

FieldTypeDefaultDescription
canCreateAnnotationsbooleantrueAllow the user to create new annotations
textAnnotationsSupportHtmlbooleantrueAllow HTML formatting in text annotation content
textAnnotationsSupportReplybooleantrueAllow replies to text annotations
textAnnotationsSupportStatusbooleantrueAllow status markers on text annotations
textAnnotationsCommentSupportReplybooleantrueAllow replies to comment annotations
annotationsSupportSecuritybooleanfalseEnable security level classification on annotations
availableSecurityLevelslistSecurity levels available to the user
annotationTemplateCatalogobjectPredefined templates for stamps and watermarks
annotationCreationRuleCatalogobjectAutomatic annotation rules (e.g., search-and-redact)
availableRedactReasonslistRedaction reason codes available to the user
defaultRedactReasonslistPre-selected redaction reasons

Broker configuration for annotation policy

The broker properties that correspond to the annotation creation policy defaults are:

Broker propertyCorresponding policy field
arender.server.annotations.can.createcanCreateAnnotations
arender.server.annotations.text.html.supporttextAnnotationsSupportHtml
arender.server.annotations.text.reply.supporttextAnnotationsSupportReply
arender.server.annotations.text.status.supporttextAnnotationsSupportStatus
arender.server.annotations.text.comment.reply.supporttextAnnotationsCommentSupportReply
arender.server.annotations.text.security.supportannotationsSupportSecurity

To disable annotation creation globally:

DSB_ARENDER_SERVER_ANNOTATIONS_CAN_CREATE=false

Annotation templates

The annotationTemplateCatalog field in the policy response contains two lists:

  • annotationTemplates: Named templates for creating annotations with pre-set properties (color, font size, rotation). These appear as toolbar items in the viewer.
  • waterMarkTemplates: Templates specifically used for watermarks. They use the Stamp type with a fixed text layout.

Example template:

{
"name": "Urgent",
"annotationType": "Stamp",
"contentTemplate": "URGENT",
"annotationStyle": {
"fontColor": "#e50000",
"fontSize": 30,
"rotation": 350
}
}

Annotation creation rules

Rules in annotationCreationRuleCatalog let users trigger automated annotation creation based on a search expression. A common use case is search-and-redact across all pages.

Example rule:

{
"ruleId": "annotationCreationRuleRedactMailsAllPages",
"ruleName": "Redact all e-mail addresses",
"annotationTemplate": {"annotationType": "RedactText"},
"searchOptions": {
"searchText": "^\\w+@\\w+\\.\\w+$",
"regex": true,
"searchAction": "ALL_PAGES"
}
}