Skip to content
ComPDF
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Add Annotation Tool

You can add annotation tool in the Web PDF Viewer. The following code shows you how to add annotation tools:

javascript
// You can get all tools and set the tool you want.
const tools = docViewer.getToolMap();

const style = docViewer.getTool('ink')
style.borderWidth = 5
UI.registerTool({
  toolName: 'ink1',
  tool: 'ink',
  style
})
UI.setActiveTool('ink1')