Skip to content
ComPDF
Guides

Annotation Toolbar

In annotation mode, a toolbar (CAnnotationToolbar) appears at the bottom for users to select annotation types and tools. AnnotationsConfig controls the available annotation types, tool buttons, and behavior switches.

Available Annotation Types

availableTypes controls the annotation type buttons shown in the toolbar. Types not in the list will be hidden:

json
{
  "annotationsConfig": {
    "availableTypes": [
      "note",
      "highlight",
      "underline",
      "squiggly",
      "strikeout",
      "ink",
      "ink_eraser",
      "circle",
      "square",
      "arrow",
      "line",
      "freetext",
      "signature",
      "stamp",
      "pictures",
      "link",
      "sound"
    ]
  }
}

Annotation Type Reference

ValueDescription
noteSticky note
highlightHighlight
underlineUnderline
squigglySquiggly
strikeoutStrikeout
inkHandwriting/pen
ink_eraserEraser
circleCircle/ellipse
squareRectangle
arrowArrow
lineLine
freetextFree text box
signatureHandwritten signature
stampStamp
picturesImage annotation
linkLink
soundAudio annotation

To show only highlight and handwriting:

json
{
  "annotationsConfig": {
    "availableTypes": [
      "highlight",
      "ink"
    ]
  }
}

Available Tools

availableTools controls the tool buttons on the right side of the annotation toolbar:

json
{
  "annotationsConfig": {
    "availableTools": [
      "setting",
      "undo",
      "redo"
    ]
  }
}
ValueDescription
settingProperties button — opens the property editor panel for the current annotation type
undoUndo
redoRedo

If the tools list is empty, the tool area UI will be hidden.

Annotation Author

json
{
  "annotationsConfig": {
    "annotationAuthor": "Guest"
  }
}

This name will be used as the annotation author when creating annotations.

Behavior Switches

FieldTypeDefaultDescription
autoShowSignPickerbooleantrueWhether to automatically show the signature picker after selecting the signature tool
autoShowStampPickerbooleantrueWhether to automatically show the stamp picker after selecting the stamp tool
autoShowPicPickerbooleantrueWhether to automatically show the image picker after selecting the image tool
autoShowLinkDialogbooleantrueWhether to automatically show the link edit dialog after creating a link annotation
interceptNoteActionbooleanfalseWhether to intercept the default click behavior of note annotations (allows custom handling via callback)
interceptLinkActionbooleanfalseWhether to intercept the default click behavior of link annotations
json
{
  "annotationsConfig": {
    "autoShowSignPicker": true,
    "autoShowStampPicker": true,
    "autoShowPicPicker": true,
    "autoShowLinkDialog": true,
    "interceptNoteAction": false,
    "interceptLinkAction": false
  }
}

CAnnotationToolbar Component

CAnnotationToolbar is the core UI component of the annotation toolbar, located in the com.compdfkit.tools.annotation.pdfannotationbar package.

Related classes:

ClassDescription
CAnnotationToolbarAnnotation toolbar main view
CPDFAnnotationToolListAdapterAnnotation type list adapter
CAnnotToolBeanAnnotation tool item data model
CAnnotationToolDatasAnnotation toolbar data source

When using source code integration, you can directly modify these classes for deeper customization.