Skip to content
Guides

Create, Move, and Delete Text and Images

ComPDFKit provides comprehensive methods for creating, moving, and deleting text and images.

ComPDFKit provides methods to do various operations like creating text when you are in content editor mode. You can use the mouse and keyboard to manipulate text areas on WebViewer as in Microsoft Word, you can add, copy, paste, cut, or delete text by keyboard.

javascript
// Insert Text.
docViewer.contentEditAnnotationsManager.addTextEditor({
  pageNumber: 1,
  rect: {
    left: 240,
    top: 32,
    right: 300,
    bottom: 48
  },
  fontData: {
    fontName: 'Helvetica',
    fontSize: 14,
    r: 0,
    g: 0,
    b: 0,
    opacity: 1,
    isBold: 0,
    italic: 0,
  },
  alignType: 2
});

// Insert Image.
docViewer.contentEditAnnotationsManager.addImageEditor({
  pageNumber: 1,
  rect: {
    left: 268,
    top: 100,
    right: 308,
    bottom: 138
  },
  imageBase64: '...' // Base64 format image data.
});