Skip to content

Gloss and XFDF

XFDF is the XML format for PDF annotations, standardised as ISO 19444-1. Gloss carries the same annotations as JSON. This page lists the Gloss type for each XFDF element and the Gloss field for each XFDF attribute, generated from the names the schema records, so it matches v1.json.

XFDF element Gloss type
<highlight> highlight
<underline> underline
<strikeout> strikeout
<squiggly> squiggly
<text> text
<freetext> freetext
<square> square
<circle> circle
<line> line
<polyline> polyline
<polygon> polygon
<ink> ink
<stamp> stamp
<redact> redact

Every element takes these. The element name gives the Gloss type.

XFDF Gloss Notes
name id
page page
rect rect XFDF writes it as x1,y1,x2,y2.
color color
opacity opacity
title author
contents contents
inreplyto inReplyTo
creationdate createdAt XFDF writes a PDF date string (D:20261019120000Z).
date modifiedAt XFDF writes a PDF date string.
subject subject
intent intent What a mark is for, such as a callout or an arrow (XFDF intent, PDF /IT).
none, an extension custom
XFDF Gloss Notes
coords quads
XFDF Gloss Notes
coords quads
XFDF Gloss Notes
coords quads
XFDF Gloss Notes
coords quads
XFDF Gloss Notes
icon icon The icon a note shows on the page (XFDF icon, PDF /Name).
XFDF Gloss Notes
width width
dashes dashes A dash pattern in points: lengths on, then off, repeating (XFDF dashes, PDF /D).
none cornerRadius XFDF has no attribute for it.
defaultstyle defaultStyle The keys are the CSS property names XFDF writes in its defaultstyle string, in camel case.
fringe fringe Insets from an annotation’s rect to the area it draws in, in points (PDF /RD, XFDF fringe, both in this order).
callout callout
head head The shape drawn at the end of a line (XFDF head and tail, PDF /LE).
XFDF Gloss Notes
width width
dashes dashes A dash pattern in points: lengths on, then off, repeating (XFDF dashes, PDF /D).
interior-color interiorColor
none cornerRadius XFDF has no attribute for it.
XFDF Gloss Notes
width width
dashes dashes A dash pattern in points: lengths on, then off, repeating (XFDF dashes, PDF /D).
interior-color interiorColor
XFDF Gloss Notes
start start
end end
width width
dashes dashes A dash pattern in points: lengths on, then off, repeating (XFDF dashes, PDF /D).
head head The shape drawn at the end of a line (XFDF head and tail, PDF /LE).
tail tail The shape drawn at the end of a line (XFDF head and tail, PDF /LE).
XFDF Gloss Notes
vertices vertices
width width
dashes dashes A dash pattern in points: lengths on, then off, repeating (XFDF dashes, PDF /D).
interior-color interiorColor
head head The shape drawn at the end of a line (XFDF head and tail, PDF /LE).
tail tail The shape drawn at the end of a line (XFDF head and tail, PDF /LE).
XFDF Gloss Notes
vertices vertices
width width
dashes dashes A dash pattern in points: lengths on, then off, repeating (XFDF dashes, PDF /D).
interior-color interiorColor
XFDF Gloss Notes
inklist inklist
width width
dashes dashes A dash pattern in points: lengths on, then off, repeating (XFDF dashes, PDF /D).
XFDF Gloss Notes
imagedata imagedata
rotation rotation
XFDF Gloss Notes
coords quads
interior-color interiorColor
overlay-text overlayText

The XFDF <fields> element holds the values of the form fields. Gloss writes them in the document’s fields property: an object keyed by full dotted field name, in place of one <field> element per name. XFDF nests <field> elements for a field hierarchy; Gloss joins the nested names with ., so a <field name="b"> inside <field name="a"> becomes "a.b". A field that is absent from fields differs from one set to an empty string: absent means no value is carried, while an empty string clears the field. A string fills a text, checkbox, radio, combo or single-select list field. An array of strings fills a multi-select list. An object with a signature key names a signature annotation in the same document.

XFDF Gloss
<field name="a.b"><value>x</value></field> "a.b": "x"
<field name="c"><value>x</value><value>y</value></field> "c": ["x", "y"]

See Fields, FieldValue and SignatureFieldValue.

From the creators of Inkbar and Redactr.

Format version 1 · gloss-format 1.3.0