StaticALLOW_Whether annotations can be dragged outside the page (off by default: dragging stops at the page edge and does not move in a direction where the annotation is larger than the page).
Whether annotations can be dragged outside the page (off by default: dragging stops at the page edge and does not move in a direction where the annotation is larger than the page).
Creates a tool.
The document viewer the tool works on.
Places the full signature: on the recorded signature field if any, at the recorded position if any, otherwise in the middle of the current page.
StaticallowAllows annotations to be dragged outside the page (sets ALLOW_ANNOTS_OUTSIDE_PAGE to true).
Clears the recorded position and signature field.
Clears the pad and the corresponding signature.
Called when the context menu is requested on the viewer; does nothing in the base class.
The mouse event.
Deletes all saved signatures, firing signatureDeleted for each.
Deletes a saved signature and fires signatureDeleted.
Zero-based index in the saved signatures.
StaticdisableTurns off hover cursors: the tool's own cursor is always used (sets ENABLE_ANNOTATION_HOVER_CURSORS to false).
StaticdisableTurns off automatic text selection by the edit tool (sets ENABLE_AUTO_SWITCH to false).
StaticdisallowKeeps dragged annotations inside the page (sets ALLOW_ANNOTS_OUTSIDE_PAGE to false; the default).
StaticenableTurns on hover cursors (sets ENABLE_ANNOTATION_HOVER_CURSORS to true).
StaticenableTurns on automatic text selection by the edit tool (sets ENABLE_AUTO_SWITCH to true).
Exports saved signatures: strokes for hand-drawn ones (ink XFDF when pathsOnly is false), dataURLs for images.
OptionalpathsOnly: booleanGets the full signature set with setSignature or drawn on the signature pad.
The signature annotation, or null when none.
Viewport event → the page and page coordinates under the pointer (unrotated page, top-left origin, pt).
Preview image of the signature (dataURL): hand-drawn signatures are drawn at the pad's height and the signature's width; image signatures are the image itself.
Gets how signature fields are signed.
The signing mode; ANNOTATION by default.
Whether a position (or signature field) for the next signature has been recorded.
True when a location is recorded.
Stops the preview following the pointer and removes it; clicks then only record the position.
Reads back the result of exportSignatures (one item or an array; each strokes, an image dataURL or ink XFDF) into the saved signatures.
X in signature pad pixels.
Y in signature pad pixels.
Whether there is no usable signature: no signature, an ink signature without strokes, or an image signature without image, text or icon.
True when the signature is empty.
Called when a key is pressed while the viewer has focus; does nothing in the base class.
The keyboard event.
Called on a double-click in the viewer; does nothing in the base class.
The mouse event.
Called when the left mouse button or a touch goes down on the viewer; does nothing in the base class.
The pointer event.
Places the previewed signature at the click; without one, records the position and fires locationSelected (the UI gets a signature, then calls addSignature).
Called when the pointer moves over the viewer; does nothing in the base class.
Called when the right mouse button goes down on the viewer; does nothing in the base class.
The pointer event.
Removes every listener of every event.
Call after the pad's display size changes: the pixel size becomes the display size, and existing strokes are scaled proportionally and redrawn.
Adds signatures to the saved signatures (kept in memory only) and fires signatureSaved.
A signature annotation or an array of them.
Sets the name of the tool.
The tool name.
Sets the full signature: an ink annotation (strokes, color and width copied), an image annotation or dataURL (image signature), or a stroke array; null clears it.
OptionalfileSize: numberBinds the signature pad: press and move on the canvas to write a stroke, release to end it; strokes are added to the current full signature (a new ink when there is none or it is an image).
Sets the factor by which signatures are scaled when placed on the page. Values that are not positive are ignored with a warning.
The scale factor; 1 by default.
Sets how signature fields are signed. Throws for unknown modes.
The signing mode.
Changes the tool's default style (used by annotations created afterwards); fires toolUpdated.
const { documentViewer, Annotations, Tools } = instance.Core;
const freeTextTool = documentViewer.getTool(Tools.ToolNames.FREETEXT);
freeTextTool.setStyles({ TextColor: new Annotations.Color(0, 0, 0), FontSize: '14pt', Font: 'Helvetica' });
documentViewer.getTool(Tools.ToolNames.HIGHLIGHT).setStyles({ StrokeColor: new Annotations.Color(0, 255, 0), Opacity: 0.6 });
StaticsetSets the source of the "Sign here" text (static; handler is called with the tool as this and returns the label text on signature fields). When unset, DocumentViewer draws the default "SIGN HERE" label.
Previews the signature as the pointer moves; a click places it.
Called on a tap (a touch press and release without moving); does nothing in the base class.
The pointer event.
setSignature rejects a file whose given size exceeds this (bytes) and fire fileRejected; null means no limit.
Preview following the pointer (not added to the document).
The tool's own cursor: used when switching in and when hovering over empty space (default for the edit tool, crosshair for creation tools, text for text tools, grab for pan...).
Default style of annotations created by the tool (such as StrokeColor, StrokeThickness, Opacity); changed with setStyles.
StaticENABLE_Changes the cursor on hover by what is under the pointer (annotations, handles, text); the stamp, attachment, eraser and marquee zoom tools turn it off, and it is turned back on when they switch out (Tool.ENABLE_ANNOTATION_HOVER_CURSORS).
StaticENABLE_Whether the edit tool selects text automatically when hovering over text (the edit tool selects text itself, so when this is off it neither selects text nor shows the text cursor; the instance enable / disableTextSelection must also be on). Turned off on touch screens.
Static ReadonlyEventsEvent names of the signature tool.
ReadonlyANNOTATION_ADDED: "annotationAdded"'annotationAdded': a signature annotation was added to the document.
ReadonlyFILE_REJECTED: "fileRejected"'fileRejected': setSignature rejected a file larger than ACCEPTED_FILE_SIZE; receives the reason, the limit and the file size.
ReadonlyLOCATION_SELECTED: "locationSelected"'locationSelected': a position or an empty signature field was clicked without a signature to place; receives the position and the field (or null).
ReadonlySIGNATURE_DELETED: "signatureDeleted"'signatureDeleted': a saved signature was deleted; receives the signature and its index.
ReadonlySIGNATURE_READY: "signatureReady"'signatureReady': a signature annotation was created for placing; receives the annotation and its position.
ReadonlySIGNATURE_SAVED: "signatureSaved"'signatureSaved': signatures were saved; receives the saved signatures.
Where the next signature goes (recorded when clicking a signature field or the page); cleared after addSignature uses it.
Name the tool is registered under (one of ToolNames).
Static ReadonlySigningSigning modes of signature fields (same as the SigningModes enum).
Base class for objects that fire named events. Listener arguments are passed by position.