ComPDFKit Web SDK
    Preparing search index...

    Class AnnotationManager

    Base class for objects that fire named events. Listener arguments are passed by position.

    Hierarchy (View Summary)

    Index
    addAnnotation addAnnotations addEventListener applyRedactions bringToBack bringToFront canModify canModifyContents completeExternalSign createAnnotationReply deleteAnnotation deleteAnnotations deleteSignedField demoteUserFromAdmin deregisterAnnotationType deselectAllAnnotations deselectAnnotation deselectAnnotations disableDraggingAcrossPages disableReadOnlyMode disableRedaction disableStampVectorAppearance disableWidgetTabOrdering drawAnnotations drawAnnotationsFromList enableDraggingAcrossPages enableReadOnlyMode enableRedaction enableWidgetTabOrdering exportAnnotationCommand exportAnnotations exportDocumentAnnotationCommand getAnnotationById getAnnotationByMouseEvent getAnnotationCopy getAnnotationPasteOffsets getAnnotationsByMouseEvent getAnnotationsInRect getAnnotationsList getAutoSelectOnCreatePolicy getCertificateInfo getCopiedAnnotations getCurrentUser getDisplayAuthor getEditBoxManager getFieldManager getFocusedAnnotation getFormFieldCreationManager getGroupAnnotations getNumberOfGroups getPageAnnotations getRegisteredAnnotationTypes getRootAnnotation getRotationOptions getSelectedAnnotations getSemanticDiffAnnotations getSnapDefaultOptions getStickyNoteCreationMode getTabOrder getUnselectableAnnotationTypes getWidgetPresentation groupAnnotations hasAnnotation hideAnnotation hideAnnotations hideDetachedReplies importAnnotationCommand importAnnotations isAnnotationRedactable isAnnotationSelected isAnnotationUnselectable isApplyRedactionEnabled isCreateRedactionEnabled isDraggingAcrossPagesEnabled isFormFieldFocusOutlineVisible isReadOnlyModeEnabled isUserAdmin isViewportRelativeAnnotationPositioningEnabled jumpToAnnotation pasteCopiedAnnotations prepareExternalSign promoteUserToAdmin redrawAnnotation registerAnnotationType removeAllEventListeners removeEventListener renderAppearanceDataUrl renderDigitalSignaturePreview selectAnnotation selectAnnotations setAnnotationCanvasTransform setAnnotationDisplayAuthorMap setAnnotationPasteOffsets setAnnotationRichTextStyle setAnnotationStyles setAutoSelectOnCreatePolicy setBeforeSubmitFormActionCallback setCurrentUser setFocusedAnnotation setFormFieldFocusOutlineAnnotations setNoteContents setOldStickyNoteRenderingDate setPermissionCheckCallback setRedrawThrottleRate setRotationOptions setSnapDefaultOptions setStickyNoteCreationMode setSubmitFormActionCallback setTabOrder setUnselectableAnnotationTypes setViewportRelativeAnnotationPositioning setWidgetPresentation shouldAutoSelectOnCreate showAnnotation showAnnotations showDetachedReplies sign trigger triggerAsync ungroupAnnotations updateAnnotation updateAnnotationId updateAnnotationRichTextStyle updateAnnotationState updateCopiedAnnotations verifySignature
    • Adds to the list immediately and fires annotationChanged('add'), then writes it to the document; if writing fails it is removed again and 'delete' fires. Annotations without an Id get one; geometric types (text markup / ink / lines / polygons) get their rectangle computed from the geometry.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to add.

      • Optionaloptions: AnnotationWriteOptions

        Optional write options: imported marks the change as an import (allowed in read-only mode, not recorded as a user change, reported as imported in annotationChanged); isUndoRedo reports it as undo / redo; transient keeps it only in this viewer, never written to the PDF or XFDF; creation tells whether a tool or code created it; allowReadOnlyAdmin lets an admin write in read-only mode.

      Returns Promise<void>

      A promise that resolves when the annotation has been written to the document. It rejects in read-only mode (PERMISSION_DENIED), when no document is loaded, or when writing fails.

      const { annotationManager, Annotations } = instance.Core;
      // Coordinates are PDF points measured from the top-left corner of the page.
      const rectangle = new Annotations.RectangleAnnotation({
      PageNumber: 1,
      X: 100,
      Y: 150,
      Width: 200,
      Height: 50,
      });
      rectangle.StrokeColor = new Annotations.Color(255, 0, 0);
      rectangle.StrokeThickness = 2;
      rectangle.Author = annotationManager.getCurrentUser();
      await annotationManager.addAnnotation(rectangle);
    • Adds annotations to the document: they are listed immediately, annotationChanged('add') fires, and then they are written to the document. Annotations already in the document are skipped; annotations without an Id get one.

      Parameters

      Returns Promise<void>

      const { annotationManager, Annotations } = instance.Core;
      const marks = [1, 2, 3].map(pageNumber => new Annotations.EllipseAnnotation({
      PageNumber: pageNumber,
      X: 20,
      Y: 20,
      Width: 30,
      Height: 30,
      }));
      await annotationManager.addAnnotations(marks);
    • Adds a listener for an event. Adding the same function twice for one event has no effect.

      Type Parameters

      Parameters

      • name: K

        Event name.

      • fn: (...args: AnnotationManagerEvents[K]) => void

        Listener, called with the event arguments.

      • Optionaloptions: { once?: boolean }

        Listener options.

        • Optionalonce?: boolean

          When true, the listener is removed after it runs once.

      Returns void

    • Applies redactions (ApplyRedaction): page content under the redaction boxes is deleted and the redaction annotations themselves are removed (all redaction annotations by default); enableRedaction must be called first. The page is redrawn right away (contentChanged of pagesUpdated).

      Parameters

      • Optionalannotations: Core.Annotations.Annotation[]

        The redaction annotations to apply; other annotation types are ignored. Defaults to all redaction annotations in the document.

      Returns Promise<void>

      A promise that resolves when the redactions have been applied; annotationChanged('delete') fires with imported true for the removed redactions and any annotations removed with the content under them, and the change is not recorded in undo history. It rejects with PERMISSION_DENIED when redaction is not enabled.

    • Sends an annotation to the bottom of its page's stacking order (see bringToFront for how the order is saved).

      Parameters

      Returns void

    • Brings an annotation to the top of the stacking order and redraws its page. The order is used by hit testing and drawing; it is written to the page's annotation list on save, and exported XFDF follows it too (not written for encrypted documents).

      Parameters

      Returns void

    • Whether the current user can modify this annotation: not in read-only mode or when the annotation is read-only; when setPermissionCheckCallback is set it decides, otherwise admins can modify everything and others only their own (annotations without an author too).

      Parameters

      Returns boolean

      True when the current user can modify it.

    • Checks whether the current user can modify the contents of an annotation: canModify is true and the contents are not locked (LockedContents).

      Parameters

      Returns boolean

      True when the contents can be modified.

    • Step two of external signing: fills in the signature value or CMS container and writes it into the document; the result is the same as sign, and digitalSignatureApplied fires likewise. INVALID_SOURCE when the signature does not match.

      Parameters

      • session: string | ExternalSignSession

        The session returned by prepareExternalSign, or its id. Rejects with INVALID_HANDLE when there is no such session.

      • value: ExternalSignValue

        Either signature, the raw RSA / ECDSA signature of hashToSign, or container, a complete CMS signature container.

      Returns Promise<SignResult>

      A promise that resolves with the signed file, the field name and the signature widget.

    • Adds a reply by the current user to an annotation. Fires addReply and annotationChanged('add').

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to reply to.

      • Optionaltext: string

        The reply text. Defaults to an empty string.

      Returns Promise<StickyAnnotation>

      A promise that resolves with the new reply once it has been added.

    • Removes from the list immediately and fires annotationChanged('delete'), then deletes it from the document; on failure it is put back and 'add' fires.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to delete. Annotations with NoDelete, or that the current user cannot modify, are left alone.

      • Optionaloptions: AnnotationWriteOptions & { allowReadOnlyAdmin?: boolean }

        Optional write options; see addAnnotation. With allowReadOnlyAdmin an admin can delete a sticky note in read-only mode; for other users or annotation types the promise rejects with PERMISSION_DENIED.

        • OptionalallowReadOnlyAdmin?: boolean

          Lets an admin delete a sticky note in read-only mode; rejects for other users or annotation types.

      Returns Promise<void>

      A promise that resolves when the annotation has been deleted from the document. It rejects in read-only mode, when no document is loaded, or when deleting fails.

      const { annotationManager } = instance.Core;
      const annot = annotationManager.getAnnotationById('my-annotation-id');
      if (annot)
      await annotationManager.deleteAnnotation(annot);
    • Deletes annotations: they are removed from the list and deselected immediately, annotationChanged('delete') fires (deleteReply for replies), and then they are deleted from the document; if deleting fails an annotation is put back and 'add' fires. Annotations with NoDelete or that the current user cannot modify (canModify) are left alone; this is checked regardless of imported / force / isUndoRedo. With allowReadOnlyAdmin, admins delete as usual in read-only mode. Replies of a deleted annotation that are not deleted with it become ordinary annotations.

      Parameters

      Returns Promise<void>

      A promise that resolves when the annotations have been deleted from the document. It rejects in read-only mode (PERMISSION_DENIED), when no document is loaded, or when deleting one of them fails.

      const { annotationManager } = instance.Core;
      // Delete every annotation on page 3
      const onPage3 = annotationManager.getAnnotationsList().filter(annot => annot.PageNumber === 3);
      await annotationManager.deleteAnnotations(onPage3);
    • Deletes a digitally signed signature field together with its signature, as one step in undo history: undo restores the file before the deletion (the field and its signature come back, the signature still valid), redo deletes it again. The user permission check is skipped.

      Parameters

      Returns Promise<void>

      A promise that resolves when the field has been deleted.

    • Removes admin rights from the current user and fires updateAnnotationPermission.

      Returns void

    • Removes a custom annotation class registered for an XFDF element name.

      Parameters

      • elementName: string

        The XFDF element name.

      • ctor: AnnotationCtor

        The annotation class to remove.

      Returns boolean

      False when the arguments are invalid; otherwise true.

    • Deselects all selected annotations.

      Returns void

      const { annotationManager } = instance.Core;
      annotationManager.deselectAllAnnotations();
    • Deselects annotations and fires annotationSelected (with 'deselected') and annotationDeselected. Clears the focus when the focused annotation is deselected.

      Parameters

      Returns void

    • Keeps dragged annotations on their own page.

      Returns void

    • Turns off read-only mode and fires updateAnnotationPermission.

      Returns void

    • Disallows creating and applying redactions (the default).

      Returns void

    • Stamps are not drawn as vector appearances (only the switch is stored); note: our stamps are drawn from appearance bitmaps anyway.

      Returns void

    • Turns off the tab order set with setTabOrder when filling forms.

      Returns void

    • Redraws this page's annotation layer; with overrideCanvas, draws this page's annotations into it instead: the canvas is the whole page in display orientation, the multiplier is computed from the canvas width, and appearance bitmaps are fetched before drawing.

      Parameters

      • options: {
            majorRedraw?: boolean;
            overrideCanvas?: HTMLCanvasElement;
            pageNumber: number;
        }

        pageNumber is the page to draw (1-based); overrideCanvas draws the page's annotations into this canvas instead of the annotation layer; majorRedraw has no effect.

        • OptionalmajorRedraw?: boolean

          Accepted for compatibility; currently has no effect.

        • OptionaloverrideCanvas?: HTMLCanvasElement

          Canvas to draw the page's annotations into instead of the annotation layer.

        • pageNumber: number

          The page to draw (1-based).

      Returns Promise<void>

      A promise that resolves when drawing into overrideCanvas is done; without it, resolves right away and the layer is redrawn in the next frame.

    • Redraws the annotation layers of the pages the given annotations are on.

      Parameters

      Returns Promise<void>

    • Allows dragging annotations onto other pages (the default).

      Returns void

    • Read-only: canModify is always false, and adds / deletes / modifications (except imports) and form filling reject.

      Returns void

      const { annotationManager } = instance.Core;
      annotationManager.enableReadOnlyMode();
      console.log(annotationManager.isReadOnlyModeEnabled()); // true
      annotationManager.disableReadOnlyMode();
    • Allows creating and applying redactions.

      Returns void

    • Tab moves to the next widget when filling forms (on by default).

      Returns void

    • Exports the annotations added, modified and deleted since the last call as command XFDF (add / modify / delete), then starts a new change log and clears IsModified on all annotations. Imported changes are not included.

      Returns Promise<string>

      A promise that resolves with the command XFDF string. Pending annotation changes are committed first.

    • Exports XFDF. fields / links both default to included without annotationList, and to excluded with it: links decides ; fields writes field values in . Widgets live in the PDF and are not written. With useDisplayAuthor, title uses the name mapped by setAnnotationDisplayAuthorMap. generateInlineAppearances is not used (appearances are in the engine).

      Parameters

      • Optionaloptions: ExportAnnotationsOptions

        Optional: annotationList exports only these annotations; links includes link elements and fields includes field values (both default to true without annotationList and false with it); useDisplayAuthor writes author names mapped by setAnnotationDisplayAuthorMap; generateInlineAppearances has no effect.

      Returns Promise<string>

      A promise that resolves with the XFDF string. Pending annotation changes are committed first; it rejects when no document is loaded.

      const { annotationManager } = instance.Core;
      const xfdf = await annotationManager.exportAnnotations();
      localStorage.setItem('annotations', xfdf);
      // Only the annotations on page 1
      const page1 = annotationManager.getAnnotationsList().filter(annot => annot.PageNumber === 1);
      const page1Xfdf = await annotationManager.exportAnnotations({ annotationList: page1 });
    • Exports all annotation changes since the document was loaded as command XFDF; unlike exportAnnotationCommand, the change log is never cleared.

      Returns Promise<string>

      A promise that resolves with the command XFDF string. Pending annotation changes are committed first.

    • Finds an annotation by its Id.

      Parameters

      • id: string

        The annotation Id.

      Returns Core.Annotations.Annotation | null

      The annotation, or null when not found.

      const { annotationManager } = instance.Core;
      const annot = annotationManager.getAnnotationById('my-annotation-id');
      if (annot)
      annotationManager.jumpToAnnotation(annot);
    • The topmost visible annotation under the pointer. includeWidgetsAndLinks defaults to false: form widgets and links are excluded (pass true explicitly when they need to be hit: filling forms, clicking links, creating widgets).

      Parameters

      • e: Pick<MouseEvent, "clientX" | "clientY">

        A mouse or pointer event; only clientX and clientY are read.

      • OptionalincludeWidgetsAndLinks: boolean

        Also hit form widgets and links. Defaults to false.

      Returns Core.Annotations.Annotation | null

      The topmost hit annotation, or null when nothing is under the pointer, no document is loaded or annotations are disabled.

    • A new annotation of the same type with copied properties (including geometry, style, content), without an Id and not in the document.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to copy.

      • Optional_options: { copyAssociatedLink?: boolean }

        Unused; kept for compatibility.

        • OptionalcopyAssociatedLink?: boolean

          Accepted for compatibility; currently has no effect.

      Returns Core.Annotations.Annotation

      The copy, on the same page, not a reply and not grouped. Stamp images and file attachment data are shared with the copy.

    • Gets the offset of each paste relative to the previous one.

      Returns { x: number; y: number }

      A copy of the offsets in PDF points; { x: 0, y: 5 } by default.

      • x: number

        Horizontal offset in PDF points.

      • y: number

        Vertical offset in PDF points.

    • All visible annotations under the pointer, topmost first; includeWidgetsAndLinks as in getAnnotationByMouseEvent, excluding form widgets and links by default.

      Parameters

      • e: Pick<MouseEvent, "clientX" | "clientY">

        A mouse or pointer event; only clientX and clientY are read.

      • OptionalincludeWidgetsAndLinks: boolean

        Also hit form widgets and links. Defaults to false.

      Returns Core.Annotations.Annotation[]

      The hit annotations, topmost first; empty when none, when no document is loaded or when annotations are disabled. Hidden annotations, replies and annotations that cannot be selected are excluded.

    • Marquee selection: selectable annotations on this page whose bounding box intersects the rectangle; replies, hidden ones, links, redactions and widgets outside form field creation mode are excluded.

      Parameters

      • pageNumber: number

        The page number (1-based).

      • rect: { x1: number; x2: number; y1: number; y2: number }

        The selection rectangle in PDF points, with x1 / y1 the top-left and x2 / y2 the bottom-right corner.

        • x1: number

          Left edge in PDF points.

        • x2: number

          Right edge in PDF points.

        • y1: number

          Top edge in PDF points.

        • y2: number

          Bottom edge in PDF points.

      Returns Core.Annotations.Annotation[]

      The annotations whose bounding box intersects the rectangle, in stacking order (bottom first).

    • Gets all annotations in the document, in page order and, within a page, from bottom to top.

      Returns Core.Annotations.Annotation[]

      A copy of the annotation list.

      const { annotationManager, Annotations } = instance.Core;
      const rectanglesOnPage1 = annotationManager.getAnnotationsList()
      .filter(annot => annot instanceof Annotations.RectangleAnnotation && annot.PageNumber === 1);
    • Reads a PKCS#12 certificate (.p12 / .pfx) before signing: checks the password and returns the signing certificate's summary and details (subject CN and so on, issuer, validity, version, signature algorithm, public key, key usage, basic constraints, key identifiers, policies, CRL distribution points, authority information access, SHA-1 / MD5, the same as the certificate in verifySignatures results). Use it to show the certificate before signing digitally. Does not change the document; password defaults to an empty string. PASSWORD_REQUIRED for a wrong password; INVALID_SOURCE when it is not PKCS#12 or the algorithm is not supported.

      Parameters

      • certificate: ArrayBuffer | Uint8Array<ArrayBufferLike>

        The PKCS#12 file bytes.

      • Optionalpassword: string

        The certificate password. Defaults to an empty string.

      Returns Promise<VerificationCertificate>

      A promise that resolves with the certificate summary and details. It rejects with PASSWORD_REQUIRED for a wrong password and INVALID_SOURCE when it is not PKCS#12 or the algorithm is not supported.

    • Gets the annotations copied by updateCopiedAnnotations (the selection at that time, excluding text markup).

      Returns Core.Annotations.Annotation[]

      The copied annotations; empty when nothing was copied.

    • Gets the current user name (author of new annotations and replies).

      Returns string

      The user name; 'Guest' by default.

    • Gets the author name to display, mapped by the function set with setAnnotationDisplayAuthorMap.

      Parameters

      • author: string

        The author name stored in the annotation.

      Returns string

      The mapped name, or author unchanged when no map is set.

    • Gets the manager of the in-place text editors of free text annotations and form fields.

      Returns EditBoxManager

      The edit box manager.

    • Gets the form field manager.

      Returns FieldManager

      The field manager.

      const { annotationManager } = instance.Core;
      const field = annotationManager.getFieldManager().getField('customerName');
      if (field)
      await field.setValue('Jane Doe');
    • The group it belongs to: the primary annotation first, followed by its grouped children; just itself when ungrouped.

      Parameters

      Returns Core.Annotations.Annotation[]

      The primary annotation followed by its grouped children; [annotation] when it is not grouped; empty when the primary annotation is not in the document.

    • How many groups these annotations belong to (each ungrouped one counts as a group).

      Parameters

      Returns number

      The number of distinct groups; annotations of the same group count once.

    • Returns the annotations on one page, in drawing order (earlier ones are drawn below later ones). Replies attached to another annotation are left out, as they are not drawn on the page; use getAnnotationsList() to include them.

      Parameters

      • pageNumber: number

        Page number (1-based).

      Returns Core.Annotations.Annotation[]

      A new array of the page's annotations, including form field widgets and links; empty when the page has none.

      const { annotationManager, Annotations } = instance.Core;
      const [first] = annotationManager.getPageAnnotations(1); // the first annotation on page 1
      const rectangles = annotationManager.getPageAnnotations(1).filter(a => a instanceof Annotations.RectangleAnnotation);
    • Gets the custom annotation classes registered for each XFDF element name.

      Returns Record<string, AnnotationCtor[]>

      Element name to registered classes.

    • Gets the options of the rotation handle.

      Returns RotationOptions

      A copy of the options.

    • Gets the selected annotations.

      Returns Core.Annotations.Annotation[]

      A copy of the selected annotations, in selection order; empty when none is selected.

      const { annotationManager } = instance.Core;
      const selected = annotationManager.getSelectedAnnotations();
      await annotationManager.deleteAnnotations(selected);
    • Gets the snapping options of measurement tools: snap radius (screen pixels), indicator size and indicator color.

      Returns SnapOptions

      A copy of the options.

    • Gets the sticky note creation mode.

      Returns "immediate" | "draft"

      'immediate' (default) or 'draft'.

    • Gets the tab order of form widgets: the order set with setTabOrder (widgets no longer in the document are dropped, unlisted ones follow), or document order (page order, then PDF order within a page) when none was set.

      Parameters

      • OptionalpageNumber: number

        Optional page number (1-based); only widgets on that page are returned.

      Returns WidgetAnnotation[]

      The widgets in tab order.

    • Gets the annotation types that cannot be selected.

      Returns string[]

      A copy of the type list set with setUnselectableAnnotationTypes.

    • Gets the widget presentation set with setWidgetPresentation.

      Returns { allowInteractionInCreationMode: boolean; showHiddenWidgets: boolean } | null

      The presentation (with a reader function resolved to its current value), or null when the normal policy applies.

      • { allowInteractionInCreationMode: boolean; showHiddenWidgets: boolean }
        • allowInteractionInCreationMode: boolean

          Widgets can be filled in form field creation mode.

        • showHiddenWidgets: boolean

          Widgets that are invisible, hidden or NoView are displayed.

      • null
    • Groups annotations under a primary annotation: each one is attached to primary (InReplyTo = primary.Id, ReplyType = 'group'), together with its own grouped children, and committed with updateAnnotation.

      Parameters

      Returns Promise<void>

      A promise that resolves when all changed annotations have been committed.

    • Whether this exact annotation object is in the document.

      Parameters

      Returns boolean

      True when the annotation is managed by this manager.

    • Hides an annotation (see hideAnnotations).

      Parameters

      Returns Promise<void>

      A promise that resolves when the change has been committed.

      const { annotationManager } = instance.Core;
      const annot = annotationManager.getAnnotationById('my-annotation-id');
      await annotationManager.hideAnnotation(annot);
      await annotationManager.showAnnotation(annot);
    • Hides annotations: sets Hidden, clears their focus and selection, fires annotationHidden, then commits each with updateAnnotation (annotationChanged('modify'), recorded in undo history, written on save).

      Parameters

      Returns Promise<void>

      A promise that resolves when all changes have been committed; it rejects like updateAnnotation.

    • Hides replies whose parent annotation is missing (the default).

      Returns void

    • Applies a command XFDF (add / modify / delete), as importAnnotations does.

      Parameters

      • command: string | Blob

        The command XFDF, as a string or a File / Blob holding it.

      Returns Promise<Core.Annotations.Annotation[]>

      A promise that resolves with the added, modified and deleted annotations.

    • Imports annotations from XFDF: new annotations are added ('add') and existing ones with the same Id are updated in place ('modify'), both with imported: true; annotations removed by a command XFDF <delete> are deleted. The XFDF can be a string or a File / Blob holding it. Resolves with the added, modified and deleted annotations.

      Parameters

      • xfdf: string | Blob

        The XFDF, as a string or a File / Blob holding it. Command XFDF (add / modify / delete) is applied as well, and field values in fields are filled in.

      Returns Promise<Core.Annotations.Annotation[]>

      A promise that resolves with the added, modified and deleted annotations. It rejects with a TypeError for other input and when no document is loaded.

      const { documentViewer, annotationManager } = instance.Core;
      documentViewer.addEventListener('annotationsLoaded', async () => {
      const xfdf = localStorage.getItem('annotations');
      if (xfdf) {
      const annotations = await annotationManager.importAnnotations(xfdf);
      console.log(`Imported ${annotations.length} annotations`);
      }
      });
    • Checks whether an annotation is a redaction annotation that can be applied (redaction must be enabled with enableRedaction and a document loaded).

      Parameters

      Returns boolean

      True when it can be applied.

    • Checks whether the annotation's type is in the list set with setUnselectableAnnotationTypes. This is independent of Locked, Hidden and document permissions.

      Parameters

      Returns boolean

      True when its type cannot be selected.

    • Whether redactions can be applied: redaction is enabled and a document is loaded.

      Returns boolean

      True when redactions can be applied.

    • Whether redaction annotations can be created.

      Returns boolean

      True when redaction is enabled.

    • Whether annotations can be dragged onto other pages.

      Returns boolean

      True when dragging across pages is enabled.

    • Checks whether the focus outline is shown for a widget: it is one of the widgets set with setFormFieldFocusOutlineAnnotations and can currently be filled (visible, not read-only, not a push button or a signed signature field, not in form field creation mode). It never grants editing or changes focus.

      Parameters

      Returns boolean

      True when the outline is shown.

    • Whether read-only mode is on.

      Returns boolean

      True in read-only mode.

    • Whether the current user is an admin.

      Returns boolean

      True for an admin.

    • Checks whether pasting uses viewport-relative positions by default (see setViewportRelativeAnnotationPositioning).

      Returns boolean

      True when enabled; false by default.

    • Scrolls to the annotation's page and centers the annotation in the viewport (aligns its top-left when the viewport is smaller than the annotation).

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to scroll to.

      • Optionaloptions: JumpOptions

        Optional. zoom zooms to this level first (1 is 100%; the current zoom is kept by default); fitToView zooms so the whole annotation fits the viewport and takes precedence over zoom; horizontalOffset / verticalOffset (such as '25%') place the annotation center at that percentage of the viewport instead of the middle; isSmoothScroll is accepted but scrolling is always immediate. Does nothing when no document is loaded.

      Returns void

      const { annotationManager } = instance.Core;
      const annot = annotationManager.getAnnotationById('my-annotation-id');
      if (annot)
      annotationManager.jumpToAnnotation(annot, { zoom: 2 });
    • Pastes the copied annotations and selects what was pasted:

      • by default onto the current page, offset by another getAnnotationPasteOffsets for each paste on the same page;
      • with pasteToMousePosition, the first copy's top-left goes to the last mouse position (on that page), the rest keep their relative positions;
      • with options.viewportRelative, back to the same place in the viewport as at copy time (on the current page), plus the offset. Nothing goes beyond the page.

      Parameters

      • OptionalpasteToMousePosition: boolean

        Paste at the last mouse position. Defaults to false; ignored when pasting at viewport-relative positions.

      • Optionaloptions: { viewportRelative?: boolean }

        Optional. viewportRelative pastes at the same viewport position as at copy time; defaults to the setViewportRelativeAnnotationPositioning setting.

        • OptionalviewportRelative?: boolean

          Paste at the same viewport position as at copy time; defaults to the setViewportRelativeAnnotationPositioning setting.

      Returns Promise<void>

      A promise that resolves after the copies have been added and selected. Does nothing in read-only mode or when nothing was copied; it rejects like addAnnotations.

    • Step one of external signing, for when the private key is not local (HSM, cloud signing, smart card). Takes the signing certificate (DER) and certificate chain, draws the appearance and writes a file with a placeholder, and returns the hash to sign (SHA-256); call completeExternalSign with the signature. Do not change the document between the two steps.

      Parameters

      • field: string | SignatureWidgetAnnotation | null | undefined

        The signature field name or widget; omit it (undefined or null) to use the selected signature field. Rejects with INVALID_HANDLE when the field is not found or none is selected.

      • options: ExternalSignOptions

        The signing certificate (DER), optional certificate chain, appearance (image bytes, a document page or a text appearance), reason, location and the space reserved for the signature (estimatedContentsSize, 16384 bytes by default).

      Returns Promise<ExternalSignSession>

      A promise that resolves with the session: its id, the field name, the digest algorithm ('SHA-256'), the hash to sign and the document digest.

    • Admins can modify other users' annotations.

      Returns void

      const { annotationManager } = instance.Core;
      annotationManager.setCurrentUser('Reviewer');
      annotationManager.promoteUserToAdmin(); // can now modify annotations by other authors
    • Redraws the annotation layer of the annotation's page.

      Parameters

      Returns void

      const { annotationManager } = instance.Core;
      const annot = annotationManager.getAnnotationById('my-annotation-id');
      annot.Opacity = 0.5;
      annotationManager.redrawAnnotation(annot); // show the change right away
      await annotationManager.updateAnnotation(annot); // save it to the document
    • Uses your own subclass when reading or importing annotations with this XFDF element name ('square', 'freetext' and so on); later registrations win.

      Parameters

      • elementName: string

        The XFDF element name.

      • ctor: AnnotationCtor

        The annotation class to use.

      Returns boolean

      False when the arguments are invalid; otherwise true.

    • Renders the appearance of an annotation (only the annotation itself, on a transparent background) as a PNG data URL, after the annotation's pending writes finish. Used by StampAnnotation.getImageData and SignatureWidgetAnnotation.renderAppearance.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to render.

      • width: number

        Width of the image in device pixels (rounded, at least 1).

      • height: number

        Height of the image in device pixels (rounded, at least 1).

      Returns Promise<string>

      A promise that resolves with the PNG data URL, or an empty string when the annotation is not in this document or has not been written yet.

    • Renders a preview of a digital signature appearance: draws a width x height signature field appearance from the layout options and returns RGBA pixels. Use it for previews in an appearance dialog; passing the same appearance to sign produces the same appearance in the file. No signature field needs to be selected.

      Parameters

      • options: DigitalSignaturePreviewOptions

        The size (width, height) and layout: content and text lines, isContentAlignLeft, isDrawOnlyContent, isDrawLogo, and optional logo and image bytes.

      Returns Promise<RenderResult>

      A promise that resolves with the width, height and RGBA pixels of the preview. It rejects when no document is loaded.

    • Selects an annotation (see selectAnnotations).

      Parameters

      Returns void

      const { annotationManager } = instance.Core;
      const [first] = annotationManager.getAnnotationsList();
      if (first) {
      annotationManager.jumpToAnnotation(first);
      annotationManager.selectAnnotation(first);
      }
    • Selects annotations and fires annotationSelected. Annotations not in the document, unselectable or already selected are skipped.

      Parameters

      Returns void

      const { annotationManager } = instance.Core;
      const onPage2 = annotationManager.getAnnotationsList().filter(annot => annot.PageNumber === 2);
      annotationManager.selectAnnotations(onPage2);
    • Sets the transform of an annotation canvas by zoom and rotation (Core.getPageMatrix, moving the origin to the matching corner of the canvas by rotation).

      Parameters

      • ctx: CanvasRenderingContext2D

        The 2D context of the annotation canvas.

      • zoom: number

        The zoom level (1 is 100%).

      • rotation: number

        The rotation in quarter turns (0 to 3).

      Returns void

    • Sets how author names are displayed (see getDisplayAuthor).

      Parameters

      • fn: (author: string) => string

        Maps an author name to the name to display.

      Returns void

    • Sets the offset of each paste relative to the previous one. Values that are not numbers keep the current offset.

      Parameters

      • offsets: { x?: string | number; y?: string | number }

        x and y in PDF points (numbers or numeric strings).

        • Optionalx?: string | number

          Horizontal offset in PDF points.

        • Optionaly?: string | number

          Vertical offset in PDF points.

      Returns void

    • Sets the rich text style of the annotation and commits it with updateAnnotation (for free text the style is written to the rich text contents and the appearance follows it). Commit failures are logged, not thrown.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to change, usually a free text annotation.

      • style: RichTextStyle | null

        The rich text style to apply to the whole text; null removes the rich text style.

      Returns void

    • Assigns style properties to the annotation (StrokeColor, FillColor, Opacity, StrokeThickness and so on) and commits it with updateAnnotation.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to change.

      • styles: Record<string, unknown>

        Property names and values to assign to the annotation.

      Returns Promise<void>

      A promise that resolves when the change has been committed; it rejects like updateAnnotation.

    • Sets whether annotations are selected after they are created by a tool. Existing selections and imported or replayed annotations are not affected.

      Parameters

      • policy: AutoSelectOnCreatePolicy

        'all' selects every created annotation, 'none' never selects, 'tool-default' (the default) follows each tool's own default, and 'legacy-default' selects only annotations completed by a tool whose default is to select. Throws a TypeError for other values.

      Returns void

    • Sets the function called before a SubmitForm action submits.

      Parameters

      • callback: (info: SubmitFormInfo) => boolean | void

        Receives the URL, whether it is FDF, whether empty fields are included, and the listed field names; returning false cancels the submission.

      Returns void

    • Sets the current user name: the author of new annotations, replies and state replies, and the user checked by canModify. Fires updateAnnotationPermission.

      Parameters

      • name: string

        The user name.

      Returns void

      const { annotationManager } = instance.Core;
      annotationManager.setCurrentUser('Jane Doe');
      console.log(annotationManager.getCurrentUser()); // 'Jane Doe'
    • Sets the focused annotation. Focus is independent of the selection: the previous annotation receives 'blur', the new one 'focus', annotationFocusChanged fires and the affected pages are redrawn. An in-place editor open on the previous annotation is closed.

      Parameters

      • annotation: Core.Annotations.Annotation | null

        The annotation to focus; null removes the focus without deselecting anything. Annotations not in the document are ignored, and setting the current one again does nothing.

      Returns void

    • Sets the form widgets that show the focus outline used for keyboard form navigation; an empty array (the default) disables the outline. This affects only how widgets are drawn: it does not change focus, the selection or fire events.

      Parameters

      • annotations: readonly WidgetAnnotation[]

        The widgets that may show the outline; annotations that are not widgets or not in the document are ignored. The focused annotation's page is redrawn when the set changes.

      Returns void

    • Sets the contents of an annotation, fires setNoteText and commits the change.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to change.

      • contents: string

        The new contents.

      • Optionaloptions: { allowReadOnlyAdmin?: boolean }

        Optional. With allowReadOnlyAdmin: true an admin can edit a sticky note in read-only mode; for other users or annotation types it throws PERMISSION_DENIED.

        • OptionalallowReadOnlyAdmin?: boolean

          Lets an admin edit a sticky note in read-only mode; throws for other users or annotation types.

      Returns Promise<void>

      A promise that resolves when the change has been committed; it rejects like updateAnnotation.

    • Stores a date before which notes would be drawn in an older style. Notes have only one style here, so only the date is stored.

      Parameters

      • date: Date

        The date.

      Returns void

    • Sets a callback that decides whether the current user can modify an annotation, replacing the default author and admin check (read-only mode still applies).

      Parameters

      • fn: (author: string, annotation: Core.Annotations.Annotation) => boolean

        Receives the annotation's author and the annotation; returns true to allow modifying it.

      Returns void

      const { annotationManager } = instance.Core;
      // Allow editing your own annotations and those marked as shared
      annotationManager.setPermissionCheckCallback((author, annotation) =>
      author === annotationManager.getCurrentUser() || annotation.getCustomData('shared') === 'true');
    • Has no effect: redraws of the annotation layer are already merged per frame. Kept for compatibility.

      Parameters

      • _ms: number

        Unused; kept for compatibility.

      Returns void

    • Options of the rotation handle: isEnabled shows the rotation handle; defaultRotationType defaults to free rotation, with hotkeyTogglesRotationType true holding Shift switches to the other mode; snapAngleStepSizeInDegrees is the step of stepped rotation (0–180°).

      Parameters

      • options: Partial<RotationOptions>

        The options to change; omitted keys keep their values. Throws INVALID_SOURCE for an unknown defaultRotationType or a snap angle outside (0, 180]. The annotation layers are redrawn.

      Returns void

    • Sets the snapping options of measurement tools.

      Parameters

      • options: Partial<SnapOptions>

        radiusThreshold (snap radius in screen pixels), indicatorSize and indicatorColor; omitted and unknown keys are ignored.

      Returns void

    • Sets how sticky notes are created by the tool. Drafts already in progress keep their mode.

      Parameters

      • mode: "immediate" | "draft"

        'immediate' (the default) or 'draft'. Throws a TypeError for other values.

      Returns void

    • Sets the function that receives the server response after a SubmitForm action succeeds. Without it a warning is logged.

      Parameters

      • callback: (response: string) => void

        Receives the response text.

      Returns void

    • Sets the order in which Tab moves between widgets when filling forms (across pages, in the given order).

      Parameters

      • widgets: WidgetAnnotation[]

        The widgets in tab order; the array is copied. Widgets not listed follow in document order.

      Returns void

    • Sets the annotation types that cannot be selected, clicked or marquee-selected. Names are XFDF element names (such as 'square', 'ink', 'freetext') or widget names ('textfield', 'checkbox', 'radiobutton', 'pushbutton', 'listbox', 'combobox', 'signatureFields'); redactions are 'redaction'. Measurements have their own names: rectangleMeasurement, inkMeasurement (arc), lineMeasurement, polylineMeasurement, polygonMeasurement, circleMeasurement; squareMeasurement, arcMeasurement and curveMeasurement are also accepted. Unknown names are kept for custom annotation types. Selected annotations of these types are deselected (with more than one selected annotation, the whole selection is cleared). This is independent of Locked, Hidden and document permissions.

      Parameters

      • types: readonly string[]

        The type names; the array is copied. Replaces the previous list; an empty array makes every type selectable again. Throws a TypeError when it is not an array of strings.

      Returns void

    • Sets whether pasteCopiedAnnotations puts the copies back at the same position in the viewport as when they were copied. False by default; an explicit options.viewportRelative of pasteCopiedAnnotations takes precedence.

      Parameters

      • enabled: boolean

        True to paste at viewport-relative positions.

      Returns void

    • Sets how form widgets are presented on screen. It does not change PDF flags, field values, the selection or form field creation mode. Without a call, the normal display and interaction rules apply.

      Parameters

      • options:
            | {
                allowInteractionInCreationMode: boolean
                | (() => boolean);
                showHiddenWidgets: boolean;
            }
            | null

        showHiddenWidgets displays widgets that are invisible, hidden or NoView; allowInteractionInCreationMode lets widgets be filled in form field creation mode, either a boolean or a function read each time it is needed (an open editor is not refreshed when its value changes). null restores the normal rules. Throws a TypeError for other values. The annotation layers are redrawn.

        • {
              allowInteractionInCreationMode: boolean | (() => boolean);
              showHiddenWidgets: boolean;
          }
          • allowInteractionInCreationMode: boolean | (() => boolean)

            Whether widgets can be filled in form field creation mode, or a function read each time it is needed.

          • showHiddenWidgets: boolean

            Display widgets that are invisible, hidden or NoView.

        • null

      Returns void

    • Decides whether a newly created annotation is selected, by the policy set with setAutoSelectOnCreatePolicy.

      Parameters

      • toolDefault: boolean

        Whether the creating tool selects by default.

      • Optionalcreation: AnnotationCreation

        Where the annotation comes from; with the 'legacy-default' policy only { source: 'tool', autoSelect: true } selects.

      Returns boolean

      True when the annotation should be selected.

    • Shows replies whose parent annotation is missing as ordinary notes on the page.

      Returns void

    • Digitally signs a signature field with a PKCS#12 certificate (bytes and password). The first argument is the field name (a signature field object is also accepted), optionally with reason and location; appearance is the signature field appearance: an image (PNG / JPEG bytes) or a document (the page appearancePageNumber, page 1 by default); without it, when the field has no hand-drawn / image signature, "signed by, date, reason, location" is drawn (the engine default is blank). With an appearance, an earlier hand-drawn / image signature on the field (drawn appearance or linked signature annotation) is removed first, so the new appearance replaces it instead of stacking. The certificate is PKCS#12 (.p12 / .pfx, 3DES / RC2 / AES encryption, RSA or EC P-256 / P-384 / P-521 keys); the private key is decrypted in the Worker and signs through WebCrypto, and the CMS carries signedAttrs (signingCertificateV2 as required by the PAdES baseline), validating with standard tools. The signature is written into the document right away, and getFileData then only saves incrementally (a full rewrite would invalidate the signature); returns the signed file, field name and signature field, and the same object is fired with digitalSignatureApplied. PASSWORD_REQUIRED for a wrong password; INVALID_SOURCE when it is not PKCS#12 or the algorithm is not supported; note: the engine cannot write contactInfo (only a warning is logged). field may be omitted (undefined / null): the selected signature field is signed; INVALID_HANDLE when none is selected; appearance may also be a text appearance (DigitalSignatureTextAppearance: content lines, large text on the left, left-aligned content and so on), laid out by the engine.

      Parameters

      • field: string | SignatureWidgetAnnotation | null | undefined

        The field name or the signature widget. Omit it (undefined or null) to sign the selected signature field (ComPDFKit extension).

      • options: SignOptions

        The certificate, password, reason, location and appearance. The appearance can also be a DigitalSignatureTextAppearance (ComPDFKit extension).

      Returns Promise<SignResult>

      The signed file, the field name and the signature widget.

    • Removes group membership from annotations (only annotations whose ReplyType is 'group') and commits them.

      Parameters

      Returns Promise<void>

    • Commits changes made to the annotation object: fires annotationChanged('modify') immediately and writes the changes to the document. Commits of the same annotation are applied in order; if the document rejects a change, the annotation is rolled back to the saved state and the promise rejects.

      Parameters

      • annotation: Core.Annotations.Annotation

        The changed annotation; it must be in the document.

      • Optionaloptions: AnnotationWriteOptions

        Optional write options; see addAnnotation. With imported the change is not recorded as a user change and is allowed in read-only mode.

      Returns Promise<void>

      A promise that resolves when the change has been written. It rejects in read-only mode (PERMISSION_DENIED), when the annotation is not in the document (INVALID_HANDLE), or when the document rejects the change (CONFLICT or INTERNAL; the annotation is rolled back and annotationChanged('modify') fires again).

      const { annotationManager, Annotations } = instance.Core;
      const annot = annotationManager.getAnnotationById('my-annotation-id');
      annot.StrokeColor = new Annotations.Color(0, 0, 255);
      annot.setContents('Checked');
      annot.setCustomData('status', 'reviewed');
      await annotationManager.updateAnnotation(annot);
    • Changes the Id of an annotation in the document (written to its /NM name). No annotationChanged event fires.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to rename; it must be in the document.

      • newId: string

        The new Id; it must not be used by another annotation.

      Returns Promise<void>

      A promise that resolves when the document has been updated. It rejects with INVALID_HANDLE when the annotation is not in the document or newId is taken, and when the document rejects the change.

    • Applies a style to the characters in [start, end) of the annotation's rich text and commits the change. Logs a warning and does nothing when start is greater than end.

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation to change.

      • style: Record<string, unknown>

        Style to apply (underline, line-through, font-weight, font-style, color, font-family, font-size).

      • Optionalstart: number

        Index of the first character; defaults to 0.

      • Optionalend: number

        Index after the last character; defaults to the length of the contents.

      Returns void

    • Sets the review state of an annotation by adding a hidden state reply (a sticky note with State / StateModel, authored by the current user). Fires addReply and annotationChanged('add').

      Parameters

      • annotation: Core.Annotations.Annotation

        The annotation whose state is set.

      • Optionalstate: string

        The state, such as 'Accepted', 'Rejected', 'Cancelled', 'Completed', 'None', 'Marked' or 'Unmarked'. Defaults to 'None'.

      • OptionalstateModel: "Marked" | "Review"

        'Review' (the default) or 'Marked'.

      • Optionalmessage: string

        Optional contents of the state reply; defaults to ' set by '.

      Returns Promise<StickyAnnotation>

      A promise that resolves with the state reply once it has been added.

    • Copies the selected annotations (text markup is attached to text and is not copied).

      Returns void

    • Verifies the digital signature of a signature field (field name or signature field object): the result is as in Document.verifySignatures, plus widget. documentStatus is unsigned when the field is not signed.

      Parameters

      • field: string | SignatureWidgetAnnotation

        The signature field name or widget. Rejects with INVALID_HANDLE when it is not found.

      • Optionaloptions: Core.VerificationOptions

        Optional: trusted certificates (DER bytes), when certificate validity is checked (validationTime), and whether offline revocation checks use the document's revocation data (on by default).

      Returns Promise<VerificationResult & { widget: SignatureWidgetAnnotation }>

      A promise that resolves with the verification result plus the verified widget. Pending annotation changes are committed first.

    Alignment: {
        CenterAlignmentTypes: typeof CenterAlignmentTypes;
        DistributeAlignmentTypes: typeof DistributeAlignmentTypes;
        StandardAlignmentTypes: typeof StandardAlignmentTypes;
    }

    Collection of the three groups of alignment types (as in Core.AnnotationManager.Alignment.StandardAlignmentTypes.LEFT); the same object as the three static members above.

    Type Declaration

    Alignment: Alignment

    Align / center / distribute.

    AnnotationChangedActions: { ADD: "add"; DELETE: "delete"; MODIFY: "modify" }

    Values of the action of annotationChanged events.

    Type Declaration

    • ReadonlyADD: "add"

      Annotations were added.

    • ReadonlyDELETE: "delete"

      Annotations were deleted.

    • ReadonlyMODIFY: "modify"

      Annotations were modified.

    CenterAlignmentTypes: typeof CenterAlignmentTypes

    Center alignment types (same as Alignment.CenterAlignmentTypes).

    DistributeAlignmentTypes: typeof DistributeAlignmentTypes

    Distribution types (same as Alignment.DistributeAlignmentTypes).

    Events: {
        ADD_REPLY: "addReply";
        ANNOTATION_CHANGED: "annotationChanged";
        ANNOTATION_DESELECTED: "annotationDeselected";
        ANNOTATION_DOUBLE_CLICKED: "annotationDoubleClicked";
        ANNOTATION_FOCUS_CHANGED: "annotationFocusChanged";
        ANNOTATION_HIDDEN: "annotationHidden";
        ANNOTATION_SELECTED: "annotationSelected";
        ANNOTATIONS_DRAWN: "annotationsDrawn";
        DELETE_REPLY: "deleteReply";
        DIGITAL_SIGNATURE_APPLIED: "digitalSignatureApplied";
        DIGITAL_SIGNATURES_CHANGED: "digitalSignaturesChanged";
        FIELD_CHANGED: "fieldChanged";
        FILE_ATTACHMENT_DATA_AVAILABLE: "fileAttachmentDataAvailable";
        SET_NOTE_TEXT: "setNoteText";
        UPDATE_ANNOTATION_PERMISSION: "updateAnnotationPermission";
        WIDGET_HIGHLIGHTING_CHANGED: "widgetHighlightingChanged";
    }

    Event names of AnnotationManager.

    Type Declaration

    • ReadonlyADD_REPLY: "addReply"

      'addReply': a reply was added.

    • ReadonlyANNOTATION_CHANGED: "annotationChanged"

      'annotationChanged': annotations were added, modified or deleted.

    • ReadonlyANNOTATION_DESELECTED: "annotationDeselected"

      'annotationDeselected': annotations were deselected.

    • ReadonlyANNOTATION_DOUBLE_CLICKED: "annotationDoubleClicked"

      'annotationDoubleClicked': an annotation was double-clicked.

    • ReadonlyANNOTATION_FOCUS_CHANGED: "annotationFocusChanged"

      'annotationFocusChanged': the focused annotation changed.

    • ReadonlyANNOTATION_HIDDEN: "annotationHidden"

      'annotationHidden': annotations were hidden or shown.

    • ReadonlyANNOTATION_SELECTED: "annotationSelected"

      'annotationSelected': annotations were selected or deselected.

    • ReadonlyANNOTATIONS_DRAWN: "annotationsDrawn"

      'annotationsDrawn': annotations of a page were drawn.

    • ReadonlyDELETE_REPLY: "deleteReply"

      'deleteReply': a reply was deleted.

    • ReadonlyDIGITAL_SIGNATURE_APPLIED: "digitalSignatureApplied"

      'digitalSignatureApplied': a digital signature was applied with sign.

    • ReadonlyDIGITAL_SIGNATURES_CHANGED: "digitalSignaturesChanged"

      'digitalSignaturesChanged': a digital signature in the document was changed by undo / redo.

    • ReadonlyFIELD_CHANGED: "fieldChanged"

      'fieldChanged': the value of a form field changed.

    • ReadonlyFILE_ATTACHMENT_DATA_AVAILABLE: "fileAttachmentDataAvailable"

      'fileAttachmentDataAvailable': the file data of a file attachment is available.

    • ReadonlySET_NOTE_TEXT: "setNoteText"

      'setNoteText': the contents of a note were changed.

    • ReadonlyUPDATE_ANNOTATION_PERMISSION: "updateAnnotationPermission"

      'updateAnnotationPermission': the current user, admin or read-only state changed.

    • ReadonlyWIDGET_HIGHLIGHTING_CHANGED: "widgetHighlightingChanged"

      'widgetHighlightingChanged': form widget highlighting was turned on or off.

    RotationTypes: {
        FREEFORM_ROTATION: "FreeformRotation";
        SNAP_ROTATION: "SnapRotation";
    }

    The two rotation modes of the rotation handle: stepped (by snapAngleStepSizeInDegrees) and free.

    Type Declaration

    • ReadonlyFREEFORM_ROTATION: "FreeformRotation"

      Rotates freely.

    • ReadonlySNAP_ROTATION: "SnapRotation"

      Rotates in steps of snapAngleStepSizeInDegrees.

    StandardAlignmentTypes: typeof StandardAlignmentTypes

    Edge alignment types (same as Alignment.StandardAlignmentTypes).