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.
Content editor mode allows users to directly edit text and images in PDF pages. ContentEditorConfig controls the editable types, tool buttons, and default text properties.
availableTypes controls the editing types displayed in the content editor toolbar:
{
"contentEditorConfig": {
"availableTypes": [
"editorText",
"editorImage"
]
}
}| Value | Description |
|---|---|
editorText | Edit text areas |
editorImage | Edit image areas |
{
"contentEditorConfig": {
"availableTools": [
"setting",
"undo",
"redo"
]
}
}| Value | Description |
|---|---|
setting | Properties button |
undo | Undo |
redo | Redo |
Configure default properties for newly created text areas via initAttribute:
{
"contentEditorConfig": {
"initAttribute": {
"text": {
"fontColor": "#000000",
"fontColorAlpha": 255,
"fontSize": 30,
"isBold": false,
"isItalic": false,
"alignment": "left",
"familyName": "Helvetica",
"styleName": "Regular"
}
}
}
}| Field | Description |
|---|---|
fontColor | Text color |
fontColorAlpha | Text opacity (0-255) |
fontSize | Font size |
isBold | Whether bold |
isItalic | Whether italic |
alignment | Alignment: "left", "center", "right" |
familyName | Font family name |
styleName | Font style |
CEditToolbar is the core UI component of the content editor toolbar, located in the com.compdfkit.tools.contenteditor.pdfcontenteditorbar package.
| Class | Description |
|---|---|
CEditToolbar | Content editor toolbar main view |
CContentEditorToolListAdapter | Edit type list adapter |
CContentEditorToolBean | Edit tool item data model |
| Edit Type | Fragment Class |
|---|---|
| Text | CEditTextPropertiesFragment |
| Image | CEditImagePropertiesFragment |
After selecting an image in content editor mode, the context menu supports the following operations:
These operations are controlled through the contentEditorMode configuration of the Context Menu.