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:
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 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. | CPDFEditType.EditText |
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. | CPDFEditType.EditImage |
Text & Image Mode | In 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 |