Rendering Charts in PDFs
When loading charts using JavaScript, it's important to allow sufficient time for JavaScript execution. Below is an example demonstrating how to configure this process:
In the code above, we've enabled JavaScript execution using the enableJavaScript
property. The waitFor
property is used to delay the rendering process and wait for the JavaScript to execute. This specific configuration, using WaitForType.JavaScript
, will wait until the window.ironpdf.notifyRender
function is called in the script or until the maximum wait time is reached.
Additionally, the CSS media option will ensure that the view and layout of the HTML content adheres to the screen settings.
Explore our GitHub examples to master rendering JS Charts to PDF with IronPDF for Node.js!