Skip to content

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Set Annotation Tool ​

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

javascript
// You can get all tools and set the tool you want.
const toolNames = Object.keys(documentViewer.getToolModeMap());

// For example, set the free text tool as the current tool.
documentViewer.setToolMode(documentViewer.getTool(Tools.ToolNames.FREETEXT));