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 Annotation ToolBar 
The default annotation toolbar contains the following annotation types and tools:
| Android | 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.
CPDFConfiguration configuration = CPDFConfiguration(
  annotationsConfig: const CPDFAnnotationsConfig(availableTypes: [
    CPDFAnnotationType.note,
    CPDFAnnotationType.highlight
  ], availableTools: [
    CPDFConfigTool.setting,
    CPDFConfigTool.undo,
    CPDFConfigTool.redo,
  ]));
// CPDFReaderWidget Sample
Scaffold(
  resizeToAvoidBottomInset: false,
  appBar: AppBar(),
  body: CPDFReaderWidget(
    document: documentPath,
    configuration: configuration,
    onCreated: (controller) {},
  ));
// ComPDFKit.openDocument Sample
ComPDFKit.openDocument(documentPath, '', configuration)2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
The customized toolbar will look like what’s shown below.
| Android | iOS | 
|---|---|
|  |  | 
Available Toolbar Customization Options 
Type 
| note | highlight | underline | squiggly | strikeout | ink | 
|---|---|---|---|---|---|
| pencil | circle | square | arrow | line | freetext | 
| signature | stamp | pictures | link | sound | 
Note: Please refer to CPDFAnnotationType for the relevant options.
pencilis only available on iOS.
Available Toolbar Tool Customization Options 
| Tool | Description | 
|---|---|
| setting | Set button, corresponding to open the selected annotation, text or picture property panel. | 
| undo | Undo annotation, content editing, form operations. | 
| redo | Redo an undone action | 
Note: Please refer to CPDFConfigTool for the relevant options.
Show or Hide Toolbar 
You can control the visibility of the bottom toolbar in annotation mode by configuring CPDFConfiguration.
CPDFConfiguration configuration = CPDFConfiguration(
  // Set whether the annotation mode bottom toolbar is visible
  toolbarConfig: const CPDFToolbarConfig(annotationToolbarVisible: false),
);2
3
4