Captions (a read-only object; change its keys). Normal is written to the file: the button text for buttons (/MK /CA), the check style ZapfDingbats character for check boxes / radios: '4' check, 'l' circle, '8' cross, 'u' diamond, 'n' square, 'H' star (the engine only knows these six); Rollover / Down only go with XFDF.
Stroke color (alias of StrokeColor).
Default value (/DV): readable and writable for text fields and combo boxes / lists, others read an empty string; commit with updateAnnotation after changing.
Default value (/DV): readable and writable for text fields and combo boxes / lists, others read an empty string; commit with updateAnnotation after changing.
Alias of fieldFlags.
Text font; a copy is made on assignment.
Font size (pt), 0 is automatic (simply font.size).
Font size (pt), 0 is automatic (simply font.size).
Whether the rotation handle is shown when selected (property form of hasRotationControlEnabled / enableRotationControl / disableRotationControl).
Whether the rotation handle is shown when selected (property form of hasRotationControlEnabled / enableRotationControl / disableRotationControl).
Text color (reads the font fill color; writes change fill and stroke colors together).
Text color (reads the font fill color; writes change fill and stroke colors together).
Property form of getValue / setValue; a failed assignment only logs a warning (use setValue to await the result).
Property form of getValue / setValue; a failed assignment only logs a warning (use setValue to await the result).
When created with a field: the field name, initial value and flags carry over to the widget.
Optionalfield: Field | nullOptionalinit: AnnotationInitAppends to the actions of this trigger; written to the file (/A, /AA) on updateAnnotation / addAnnotation.
Adds a listener (annotations are EventHandlers; form widgets fire focus / blur of WidgetAnnotation.Events).
Optionaloptions: { once?: boolean }
Optionalonce?: booleanRemove the listener after it is called once.
Links a reply to this annotation (no effect if already linked). Does not add it to the document.
The reply annotation.
Recomputes the bounding box from the content; unchanged in the base class (geometric types compute from their points).
Removes the signature: the appearance in appearance mode and the associated signature annotation in annotation mode; a digital signature is removed too (the engine's RemoveSignature cannot remove the signature value, so an incremental update removes /V and the appearance instead; see worker/signatures/clear-signature.ts).
Draws the signature annotation (ink, image stamp, etc.) as this signature field's appearance and commits (appearance mode); the signature annotation itself is not added to the document.
Removes a custom data entry; commit with updateAnnotation afterwards.
Custom data key.
Changes this annotation from an XFDF element (or a whole XFDF containing it): the element's name is replaced with this annotation's Id and imported, updating in place.
Hides the rotation handle when the annotation is selected.
Before the appearance arrives (including while being dragged out): signature fields without a background draw a light blue block (#93B9FD, opacity 0.3) without a border.
Shows the rotation handle when the annotation is selected.
Gets the actions of the annotation by trigger.
Trigger name to its actions.
The signature annotation signed in annotation mode; null when none.
Id of the content editing element this annotation represents; always undefined (content editing does not use annotations).
Always undefined.
Type of the content editing element this annotation represents; always undefined (content editing does not use annotations).
Always undefined.
Gets the text contents (/Contents) of the annotation.
The contents; an empty string when none.
Gets a custom data value stored on the annotation.
Custom data key.
The value; an empty string when the key is missing.
Gets the name of the form field this widget belongs to.
The field name.
Options of combo boxes / lists.
Gets the annotations grouped under this one.
The group members.
Gets the height of the bounding box.
Height in PDF points.
Undefined keeps the renderer's existing global/type default.
Gets the point of the bounding box that stays fixed while zooming a NoZoom annotation.
A copy of the point; x and y are fractions of the width and height (0 to 1), default { x: 0, y: 0 }.
Horizontal position as a fraction of the width (0 to 1).
Vertical position as a fraction of the height (0 to 1).
Gets the page the annotation is on.
The page number (1-based).
Previous interactive page transition, or the page at first query if none was recorded. Plain PageNumber writes do not imply a pointer transition. Page remapping resets this baseline. Viewer state only: not part of the PDF or annotation undo properties.
Gets the bounding box.
The bounding box in page coordinates (PDF points).
Margin by which the bounding box exceeds the geometry; 0 in the base class.
Gets the replies to this annotation (linked annotations that are not group members).
The reply annotations.
Gets the rich text style of the contents.
A copy of the style (character position to CSS style), or null when none.
State of the latest review state reply (a hidden note with State); an empty string when none.
The most specific class name (the last of types).
The unrotated box as { x, y, width, height } (getUnrotatedDimensions, a runtime method not declared in the d.ts; same as getUnrotatedBox, optionally given a rectangle in place of the annotation's own, derived by the annotation's Rotation).
Optionalrect: Core.Annotations.RectHeight in PDF points.
Width in PDF points.
Left edge in PDF points.
Top edge in PDF points.
Value of the owning field; the widget's own value when there is no field yet.
Point-defined annotations: viewport coordinates of each point; others log a warning and return an empty array.
Point-defined annotations: gets one point in viewport coordinates.
Zero-based point index.
The document viewer used to convert the coordinates.
The point, or null when the annotation is not point-defined or the index is out of range.
Position and rotation of the bounding box in the viewport.
Gets the width of the bounding box.
Width in PDF points.
Gets the left edge of the bounding box.
X in PDF points.
Gets the top edge of the bounding box.
Y in PDF points.
Already has a digital signature (SignatureWidgetAnnotation.hasCryptographicSignature, returns Promise
Shows the rotation handle when selected (the AnnotationManager rotation option must be on too; only point-defined annotations can rotate, see rotatable in tools/annotation-select-tool.ts).
Whether this is a content editing placeholder; always false (content editing does not use annotations).
Always false.
Synchronous form of hasCryptographicSignature (for synchronous paths such as hit tests and marquee selection; same source, updated with the Signed returned by the Worker).
Whether this annotation is a member of a group (has InReplyTo and ReplyType 'group').
True for a group member.
Whether the annotation is in content editing focus mode; always false (content editing does not use annotations).
Optional_contentEditManager: unknown
Unused.
Always false.
Internal annotation (not listed or exported); there are no such annotations here.
Appears when printing: not hidden, printable, not a reply.
Whether this annotation is a reply to another annotation (has InReplyTo and is not a group member).
True for a reply.
The appearance is a hand-drawn / image signature (signed in appearance mode).
Whether the annotation class or one of its base classes has the given name (such as 'MarkupAnnotation' or 'WidgetAnnotation').
Class name to check.
True when the name is in the class chain.
Invisible when hidden (/F Hidden) or not viewed (NoView).
Whether this is a form field widget; false in the base class.
True for widget annotations.
Redraws this widget.
Removes all event listeners of this annotation.
Removes a listener; without fn, removes all listeners of this event.
Optionalfn: AnnotationListenerThe signature field appearance rendered as a PNG dataURL; without a size it is trunc(rectangle × devicePixelRatio + 1). An empty string when not in a document (not added yet or deleted) (ComPDFKit extension).
Optionalwidth: numberOptionalheight: numberResizes to the new rectangle (use it instead of setRect when internal properties must change too; here each class's setRect already carries points / paths along, so it is setRect).
Appearance resources are all ready (our appearances are in the Worker, so always true).
The XFDF element of this annotation (such as <square .../>); asynchronous (exported by the Worker); the annotation must be added to the document first.
Sets several properties at once: fieldName, value, defaultValue, flags; missing ones are ignored.
Optionaloptions: {OptionaldefaultValue?: string | numberNew default value.
OptionalfieldName?: stringNew field name.
Optionalflags?: WidgetFlagsNew field flags.
Optionalvalue?: FieldValueNew value.
Associates a signature annotation (records the field name in its custom data, saved with the file); null removes the association.
Sets the text contents (/Contents) of the annotation.
New contents.
Commit with updateAnnotation after changing.
Sets a form field flag; commit with updateAnnotation afterwards.
Flag name, such as WidgetFlags.READ_ONLY.
Whether the flag is set.
Indicator (the same fields as FormFieldCreationManager.setShowIndicator / setIndicatorText); commit with updateAnnotation afterwards.
Optionaltext: stringCommit with updateAnnotation after changing.
Sets the height of the bounding box.
Height in PDF points.
Explicit per-widget screen highlight. Does not change the field value, PDF or history.
Marks as changed; keepDate does not update the modification date.
Optional_keepAppearance: booleanOptional_keepSerialized: booleanOptionalkeepDate: booleanSets the point of the bounding box that stays fixed while zooming a NoZoom annotation. Values outside 0 to 1 are rejected with a warning.
x and y as fractions of the width and height (0 to 1).
Horizontal position as a fraction of the width (0 to 1).
Vertical position as a fraction of the height (0 to 1).
Sets the page the annotation is on.
The page number (1-based).
Record the origin before a pointer page transition; null resets the first-query baseline.
Geometric annotations (lines, ink, polygons, text markup) override it to move their points proportionally into the new rectangle.
Like setRect, but swaps reversed coordinates (setRect here already normalizes them, so both give the same result).
Replaces the rich text style of the contents and marks the annotation as modified.
Character position to CSS style, or null to remove the rich text style.
Sets the value of the owning field (Field.setValue).
Point-defined annotations: sets all points from viewport coordinates (points are fitted into the page). Other annotations log a warning.
New points in viewport coordinates.
X in viewport units.
Y in viewport units.
The document viewer used to convert the coordinates.
Point-defined annotations: moves one point to a position in viewport coordinates. Invalid indexes and other annotations log a warning.
Zero-based point index.
New position in viewport coordinates.
X in viewport units.
Y in viewport units.
The document viewer used to convert the coordinates.
Sets the bounding box from a viewport position, size (clamped into the page) and rotation.
Height in viewport units.
Optionalrotation?: numberRotation in degrees relative to the display orientation; defaults to 0.
Width in viewport units.
Left edge in viewport units.
Top edge in viewport units.
Sets the width of the bounding box.
Width in PDF points.
Sets the left edge of the bounding box.
X in PDF points.
Sets the top edge of the bounding box.
Y in PDF points.
Signs this signature field with signature (ink or image stamp) (SignatureWidgetAnnotation#sign): places a copy by the field's rotation and size. By the signature tool's signing mode: annotation mode (default) adds the copy to the document and associates it (deleting an existing associated one first); appearance mode draws it as the field appearance; signature itself is not added to the document. Bypasses the signature tool's placement flow: does not fire locationSelected / signatureReady / annotationAdded and leaves the tool's signature and position alone (used by UI.signSignatureWidget with a signature argument). Digital signing is AnnotationManager#sign, not this. Returns a Promise like other write methods (the Worker confirms the write).
Fires an event with arguments spread by position.
Optionalargs: unknown[]Runs through Actions.Dispatcher.
Optionalevent: EventLike trigger, awaiting the Promise returned by each listener in turn.
Optionalargs: unknown[]Applies style to the characters in [start, end) (break points are added at both ends of the range first, then segments are merged).
Optionalstart: numberOptionalend: numberAuthor of the annotation (the /T entry).
Blend mode for drawing onto the page (canvas globalCompositeOperation name): 'multiply' multiplies with the page (text highlights, ink with intent InkHighlight); normal blending by default.
Creation date, or null when unknown.
Last modification date, or null when unknown; updated by setModified.
XFDF element name of this annotation type (such as 'square'); 'annotation' in the base class.
Static ReadonlyEventsEvents fired by widgets (these two of WidgetAnnotation.Events; commit / change / mouse* / render are not fired and not listed): focus when the editor (text field, combo box, list) opens and blur when it closes. Check boxes / radios / buttons have no editor and fire neither.
ReadonlyBLUR: "blur"'blur': the widget's editor closed.
ReadonlyFOCUS: "focus"'focus': the widget's editor opened.
Form field flags (/Ff) of the field.
Fully qualified name of the form field this widget belongs to.
Fill color; null means no fill (the engine clears the fill color on commit). A color written with opacity 0 is also treated as no fill.
Height of the bounding box in PDF points.
Whether the annotation is hidden (the /F Hidden flag).
Icon name (the /Name entry), used by notes, stamps and file attachments.
Unique annotation name (the /NM entry); used to look the annotation up and to link replies and groups.
Text of the form field indicator.
Id of the parent annotation of a reply or group.
The /F Invisible bit (1): only meaningful for unknown annotation types; use Hidden to hide annotations.
Whether the annotation was added since the last exportAnnotationCommand.
Whether parts drawn outside the rectangle can be clicked too (hit testing here only uses the rectangle; currently only the value is stored).
Deleted since the last exportAnnotationCommand (set by deleteAnnotation(s), cleared when added to the document again).
Changed since the last exportAnnotationCommand.
Whether the annotation is shown in annotation lists; defaults to true.
Whether the annotation cannot be deleted or have its properties changed (the /F Locked flag).
Whether the contents of the annotation cannot be changed (the /F LockedContents flag).
Whether resizing keeps the width-to-height ratio.
Static ReadonlyMeasurementDisplay format of measurement annotations (values of DisplayFormat).
ReadonlyDECIMAL: "Decimal"Decimal number.
ReadonlyFRACTION: "Fraction"Fraction.
ReadonlyROUND: "Round"Rounded value.
ReadonlyTRUNCATE: "Truncate"Truncated value.
Static ReadonlyMeasurementUnit system of measurement annotations (values of System).
ReadonlyIMPERIAL: "Imperial"Imperial units (in, ft, yd, mi).
ReadonlyMETRIC: "Metric"Metric units (mm, cm, m, km).
ReadonlyTYPOGRAPHIC: "Typographic"Typographic points.
Static ReadonlyMeasurementDisplay units of measurement annotations (values of DisplayUnits, Annotation.MeasurementUnits).
ReadonlyCM: "cm"Centimeters.
ReadonlyDOUBLE_PRIME_IN: "in\""Inches written with a double prime.
ReadonlyFT: "ft"Feet.
ReadonlyFT_IN: "ft-in"Feet and inches.
ReadonlyIN: "in"Inches.
ReadonlyKM: "km"Kilometers.
ReadonlyM: "m"Meters.
ReadonlyMI: "mi"Miles.
ReadonlyMM: "mm"Millimeters.
ReadonlyPRIME_FT: "ft'"Feet written with a prime.
ReadonlyPT: "pt"Points (1/72 inch).
ReadonlyYD: "yd"Yards.
Cannot be deleted: AnnotationManager deleteAnnotation(s) skips it (memory only, not written to the file).
Whether the annotation cannot be moved by the user.
Whether the annotation cannot be resized by the user.
Whether the annotation does not rotate with the page (the /F NoRotate flag).
Whether the annotation is not displayed (the /F NoView flag).
Whether the annotation keeps its size regardless of zoom (the /F NoZoom flag).
Opacity from 0 (transparent) to 1 (opaque); defaults to 1.
Page the annotation is on (1-based).
Whether the annotation is printed (the /F Print flag); defaults to true.
Text alignment ('Left-justified' / 'Centered' / 'Right-justified', mapping to /Q); written to the file for text fields, combo boxes and lists. The style (bold / italic) is in the font name (Helvetica-Bold, Times-Italic, etc.); see font.
Whether the annotation cannot be interacted with (the /F ReadOnly flag).
'group' means a group; otherwise a reply.
Widget rotation (/MK /R, 0 / 90 / 180 / 270 degrees; widget content rotates by it); note: the engine cannot write /MK /R, so changes are not saved to the file.
Rotation of the annotation in degrees, counterclockwise.
Selection model class (a prototype property; each class's default is set in selection/model-of.ts): when selected, new selectionModel(annotation, canModify, true, docViewer) and its draw draws the selection box. Replace it with another class on a subclass prototype or a single annotation (for example one whose draw draws nothing); hit testing and handles still follow the built-in rules.
Form field indicator (shown by the UI layer) and its text; commit with updateAnnotation after changing.
Stroke (border or line) color; defaults to black.
Stroke width in PDF points; defaults to 1.
Subject of the annotation; defaults to the subject of the annotation class.
The /F ToggleNoView bit (256).
Name of the tool that created it (written when a tool creates it, not saved to the PDF).
Width of the bounding box in PDF points.
Left edge of the bounding box in PDF points (page coordinates).
Top edge of the bounding box in PDF points (page coordinates).
CreateWidget(SignatureFields). Two ways to sign: