Perform form field double click event in React Pdfviewer component
12 Sep 20231 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.
```javascript
<PdfViewerComponent
id="container"
documentPath="https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf"
formFieldDoubleClick={formFieldDoubleClick}
style=>
</PdfViewerComponent>
function formFieldDoubleClick(args) {
//Prints the argument value in the console window
console.log(args);
}
```
```javascript
<PdfViewerComponent
id="container"
documentPath="https://cdn.syncfusion.com/content/pdf/form-filling-document.pdf"
formFieldDoubleClick={formFieldDoubleClick}
serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
style=>
</PdfViewerComponent>
function formFieldDoubleClick(args) {
//Prints the argument value in the console window
console.log(args);
}
```