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:
{
"annotationsConfig": {
"availableTypes": [
"note",
"highlight",
"underline",
"squiggly",
"strikeout",
"ink",
"ink_eraser",
"circle",
"square",
"arrow",
"line",
"freetext",
"signature",
"stamp",
"pictures",
"link",
"sound"
]
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Annotation Type Reference
| Value | Description |
|---|---|
note | Sticky note |
highlight | Highlight |
underline | Underline |
squiggly | Squiggly |
strikeout | Strikeout |
ink | Handwriting/pen |
ink_eraser | Eraser |
circle | Circle/ellipse |
square | Rectangle |
arrow | Arrow |
line | Line |
freetext | Free text box |
signature | Handwritten signature |
stamp | Stamp |
pictures | Image annotation |
link | Link |
sound | Audio annotation |
To show only highlight and handwriting:
{
"annotationsConfig": {
"availableTypes": [
"highlight",
"ink"
]
}
}2
3
4
5
6
7
8
Available Tools
availableTools controls the tool buttons on the right side of the annotation toolbar:
{
"annotationsConfig": {
"availableTools": [
"setting",
"undo",
"redo"
]
}
}2
3
4
5
6
7
8
9
| Value | Description |
|---|---|
setting | Properties button — opens the property editor panel for the current annotation type |
undo | Undo |
redo | Redo |
If the tools list is empty, the tool area UI will be hidden.
Annotation Author
{
"annotationsConfig": {
"annotationAuthor": "Guest"
}
}2
3
4
5
This name will be used as the annotation author when creating annotations.
Behavior Switches
| Field | Type | Default | Description |
|---|---|---|---|
autoShowSignPicker | boolean | true | Whether to automatically show the signature picker after selecting the signature tool |
autoShowStampPicker | boolean | true | Whether to automatically show the stamp picker after selecting the stamp tool |
autoShowPicPicker | boolean | true | Whether to automatically show the image picker after selecting the image tool |
autoShowLinkDialog | boolean | true | Whether to automatically show the link edit dialog after creating a link annotation |
interceptNoteAction | boolean | false | Whether to intercept the default click behavior of note annotations (allows custom handling via callback) |
interceptLinkAction | boolean | false | Whether to intercept the default click behavior of link annotations |
{
"annotationsConfig": {
"autoShowSignPicker": true,
"autoShowStampPicker": true,
"autoShowPicPicker": true,
"autoShowLinkDialog": true,
"interceptNoteAction": false,
"interceptLinkAction": false
}
}2
3
4
5
6
7
8
9
10
CAnnotationToolbar Component
CAnnotationToolbar is the core UI component of the annotation toolbar, located in the com.compdfkit.tools.annotation.pdfannotationbar package.
Related classes:
| Class | Description |
|---|---|
CAnnotationToolbar | Annotation toolbar main view |
CPDFAnnotationToolListAdapter | Annotation type list adapter |
CAnnotToolBean | Annotation tool item data model |
CAnnotationToolDatas | Annotation toolbar data source |
When using source code integration, you can directly modify these classes for deeper customization.