Highlight underline strikeout text in EJ2 JavaScript Pdfviewer control

8 May 20231 minute to read

The PDF Viewer library allows you to highlight, underline and strikeout text in the loaded PDF document programmatically using the setAnnotationMode() method.

Step 1: Follow the steps provided in the link to create simple PDF Viewer sample.

Step 2: Add the following code snippet to highlight, underline, and strikeout text in index.ts file with button click events.

    document.getElementById('setHighlight').addEventListener('click', ()=> {
    document.getElementById('setUnderline').addEventListener('click', ()=> {
    document.getElementById('setStrikeout').addEventListener('click', ()=> {
    document.getElementById('setNone').addEventListener('click', ()=> {

Find the Sample how to highlight, underline and strikeout text programmatically