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:

C#
CPDFDocument doc = CPDFDocument.InitWithFilePath("filePath");
CPDFViewerTool tool = new CPDFViewerTool();
tool.GetCPDFViewer().InitDoc(doc);
CPDFToolManager toolManager = new CPDFToolManager(tool);
toolManager.SetToolType(ToolType.ContentEdit);
tool.SetCurrentEditType(CPDFEditType.EditText | CPDFEditType.EditImage);

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.CPDFEditType.EditText
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.CPDFEditType.EditImage
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.CPDFEditType.EditText|CPDFEditType.EditImage