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 page editor allows users to manage PDF pages, including inserting, replacing, extracting, copying, rotating, and deleting pages. Available editing menu items can be configured via GlobalConfig.
Control the operation menus displayed in the page editor via global.pageEditor.menus:
{
"global": {
"pageEditor": {
"menus": [
"insertPage",
"replacePage",
"extractPage",
"copyPage",
"rotatePage",
"deletePage"
]
}
}
}| Value | Description |
|---|---|
insertPage | Insert page |
replacePage | Replace page |
extractPage | Extract page |
copyPage | Copy page |
rotatePage | Rotate page |
deletePage | Delete page |
To show only insert and delete:
{
"global": {
"pageEditor": {
"menus": [
"insertPage",
"deletePage"
]
}
}
}CPDFPageEditDialogFragment is the main Fragment for page editing, located in the com.compdfkit.tools.docseditor.pdfpageeditor package.
There are two ways to open the page editor:
"documentEditor" in toolbarConfig.availableMenusCPDFPageEditDialogFragment pageEditFragment = CPDFPageEditDialogFragment.newInstance();
pageEditFragment.show(getSupportFragmentManager(), "pageEdit");val pageEditFragment = CPDFPageEditDialogFragment.newInstance()
pageEditFragment.show(supportFragmentManager, "pageEdit")| Component | Description |
|---|---|
CPDFPageEditDialogFragment | Page edit dialog |
CPDFPageEditFragment | Page edit content Fragment |
CPDFPageEditAdapter | Page thumbnail grid adapter |
CPDFDocumentPageActionHelper | Page operation logic helper |
CPDFPageInsertDialogFragment provides the insert page dialog, supporting:
After selecting a page, you can replace it with pages from another PDF document.
Selected pages (one or more) can be extracted as a standalone PDF file.
Supports drag-and-drop thumbnail reordering of pages.