Page Editor
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.
Configure Available Menu Items
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
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:
- Via More menu: Include
"documentEditor"intoolbarConfig.availableMenus - Open programmatically:
CPDFPageEditDialogFragment pageEditFragment = CPDFPageEditDialogFragment.newInstance();
pageEditFragment.show(getSupportFragmentManager(), "pageEdit");val pageEditFragment = CPDFPageEditDialogFragment.newInstance()
pageEditFragment.show(supportFragmentManager, "pageEdit")Related Components
| Component | Description |
|---|---|
CPDFPageEditDialogFragment | Page edit dialog |
CPDFPageEditFragment | Page edit content Fragment |
CPDFPageEditAdapter | Page thumbnail grid adapter |
CPDFDocumentPageActionHelper | Page operation logic helper |
Insert Page
CPDFPageInsertDialogFragment provides the insert page dialog, supporting:
- Insert a blank page
- Insert from another PDF file
- Specify insert position (before first page / after last page / before/after specified page)
- Select page size
Replace Page
After selecting a page, you can replace it with pages from another PDF document.
Extract Page
Selected pages (one or more) can be extracted as a standalone PDF file.
Page Reordering
Supports drag-and-drop thumbnail reordering of pages.