html-pdf-chrome
HTML to PDF or image (jpeg, png, webp) converter via Chrome/Chromium
...If you run into CORS issues, try using the --disable-web-security Chrome flag, either when you start Chrome externally, or in options.chromeFlags. This option should only be used if you fully trust the code you are executing during a print job. It is strongly recommended that you keep Chrome running side-by-side with Node.js. There is significant overhead starting up Chrome for each PDF generation which can be easily avoided. By default, pages are saved as a PDF. To save as a screenshot instead, supply screenshotOptions. You can optionally provide an HTML template for a custom header and/or footer. ...