Setting Edit Type
After entering content editing mode, developers can control which types of elements users can edit:
- Text Editing: Add, modify, or delete text within the PDF.
- Image Editing: Insert, replace, or delete images within the PDF.
- Path Editing: Modify vector paths (such as lines or shapes) in the PDF.
Toolbar Switching
Users can switch between editing types using the bottom toolbar.
API Switching
If the bottom toolbar is hidden, you can switch edit types using the API:
tsx
const manager = pdfReaderRef.current._editManager;
// Enable text editing only
await manager.changeEditType([CPDFEditType.Text]);
// Enable both text and image editing
await manager.changeEditType([CPDFEditType.Text, CPDFEditType.Image]);
// Disable all editing (read-only)
await manager.changeEditType([CPDFEditType.NONE]);