JavaScript in HTML To PDF

Any JavaScript code within the HTML will be executed during the rendering process, whether it's from an HTML string, file, or URL to a PDF document.

To enable JavaScript execution, set the enableJavaScript property to true. In some cases, such as when loading charts and graphs with JavaScript, you may also need to set a waitFor property. This ensures that there is sufficient time for the JavaScript code to execute properly.