Skip to content
Guides

Edit Text Properties

ComPDFKit provides multiple methods to modify text properties. You can modify text font size, name, color, alignment, italic, bold, transparency, etc when you are in content editor mode. The following code shows you how to set text to 22px, black, bold, font Times-Roman, and opacity 60.

ComPDFKit for Web supports Helvetica, Courier, Times Roman, and DroidSansFallbackFull font family. DroidSansFallbackFull font is a font family that supports Chinese, Japanese, Korean, and other fonts.

javascript
const editAnnotations = await docViewer.contentEditAnnotationsManager.getEditAnnotation(1)
editAnnotation[0].setTextStyle({
  color: '#000000',
  opacity: 60,
  fontSize: 22,
  fontFamily: 'Times-Roman',
  fontStyle: 'bold'
})