Search results

Perform form field double click event in React PDF Viewer component

02 Feb 2023 / 1 minute to read

The PDF Viewer library allows you to trigger an event when you double click on the form field using the formFieldDoubleClick event.

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

Step 2: Add the following code snippet in the index.js file to add the form field double click event in the PDF Viewer.

Copied to clipboard
<PdfViewerComponent
  id="container"
  documentPath="FormFillingDocument.pdf"
  formFieldDoubleClick={this.formFieldDoubleClick}
  serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
  style={{ height: '640px' }}>
</PdfViewerComponent>

formFieldDoubleClick(args) {
    //Prints the argument value in the console window
    console.log(args);
  }