Skip to content
DemoAPI ReferenceFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub
React Native Guides Annotation toolbar

Annotation Toolbar ​

The annotation toolbar in ComPDF 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
flutter-androidflutter-ios

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
flutter-androidflutter-ios

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

Show or Hide Toolbar ​

You can control the visibility of the bottom toolbar in annotation mode by configuring CPDFConfiguration.

tsx
let config = ComPDFKit.getDefaultConfig({
  toolbarConfig: {
    annotationToolbarVisible: true // or false to hide the toolbar
  }
});