Skip to content
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 ModeDescriptionParameters
Text ModeIn 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 ModeIn 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 ModeIn 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 ModeIn 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