On this page
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.
dart
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)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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.
pencil
is 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.