On this page
Guides
Initialize Editing Mode
Before performing PDF content editing, you should initialize the content editing mode.
This example shows how to initialize editing mode:
java
CPDFReaderView readerView = findViewById(R.id.readerView);
CPDFDocument document = new CPDFDocument(context);
document.open("pdfPath");
readerView.setPDFDocument(document);
readerView.setViewMode(CPDFReaderView.ViewMode.PDFEDIT);
CPDFEditManager editManager = readerView.getEditManager();
editManager.enable();
editManager.beginEdit(CPDFEditPage.LoadText | CPDFEditPage.LoadImage | CPDFEditPage.LoadPath);
kotlin
val readerView = findViewById(R.id.readerView)
val document = CPDFDocument(context)
document.open("pdfPath")
readerView.setPDFDocument(document)
readerView.setViewMode(CPDFReaderView.ViewMode.PDFEDIT)
val editManager = readerView.getEditManager()
editManager.enable()
editManager.beginEdit(CPDFEditPage.LoadText | CPDFEditPage.LoadImage | CPDFEditPage.LoadPath)
Explanation of Editing Mode
Here is the explanation of the editing mode settings:
Editing Mode | Description | Parameters |
---|---|---|
Text Mode | In text mode, the text blocks surrounded by dotted lines will be displayed in the PDF document. Users can select text blocks and add, delete, copy, and paste text. | CPDFEditPage.LoadText |
Image Mode | In image mode, the images surrounded by dotted lines will be displayed in the PDF document. Users can select images and then delete, crop, rotate, mirror, replace, save images, or set image properties. | CPDFEditPage.LoadImage |
Path Mode | In path mode, the path in the PDF document can be selected, which can be cut, copied, moved, deleted, and so on. | CPDFEditPage.LoadPath |
Text & Image & Path Mode | In text, image and path mode, the text blocks and images surrounded by dotted lines will be displayed in the PDF document. Users can select and edit both text, images and path. | CPDFEditPage.LoadText | CPDFEditPage.LoadImage |CPDFEditPage.LoadPath |