Skip to content

Annotation Toolbar

The annotation toolbar in ComPDFKit can be flexibly configured to enable annotation types and tools. This section explains how to customize the annotation toolbar.

Default ToolBar

The default annotation toolbar contains the following annotation types and tools:

AndroidiOS

Customizing the Toolbar Buttons

You can enable or hide specific annotation types by setting the availableTypes property in the annotationsConfig object. The following example demonstrates how to only display the note and highlight annotation types.

tsx
let config = ComPDFKit.getDefaultConfig({
  annotationsConfig: {
    availableTypes: [
      CPDFAnnotationType.NOTE,
      CPDFAnnotationType.HIGHLIGHT
    ],
    availableTools: [
      CPDFConfigTool.SETTING,
      CPDFConfigTool.UNDO,
      CPDFConfigTool.REDO,
    ]
  }
});
ComPDFKit.openDocument(_document, '', config);

The customized toolbar will look like what’s shown below.

AndroidiOS

Available Toolbar Customization Options

Type
NOTEHIGHLIGHTUNDERLINESQUIGGLYSTRIKEOUTINK
PENCILCIRCLESQUAREARROWLINEFREETEXT
SIGNATURESTAMPPICTURESLINKSOUND

Note: Please refer to CPDFAnnotationType for the relevant options. PENCIL is only available on iOS.

Available Toolbar Tool Customization Options

ToolDescription
SETTINGSet button, corresponding to open the selected annotation, text or picture property panel.
UNDOUndo annotation, content editing, form operations.
REDORedo an undone action