PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
The annotation toolbar in ComPDF can be flexibly configured to enable annotation types and tools. This section explains how to customize the annotation toolbar.
The default annotation toolbar contains the following annotation types and tools:
| Android | iOS |
|---|---|
![]() | ![]() |
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.
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.
| Android | iOS |
|---|---|
![]() | ![]() |
| 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.
| 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 |
You can control the visibility of the bottom toolbar in annotation mode by configuring CPDFConfiguration.
let config = ComPDFKit.getDefaultConfig({
toolbarConfig: {
annotationToolbarVisible: true // or false to hide the toolbar
}
});