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.LoadTextImage);
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.LoadTextImage)

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
Text & Image ModeIn text and image mode, the text blocks and images surrounded by dotted lines will be displayed in the PDF document. Users can select and edit both text and images.CPDFEditPage.LoadTextImage