Ad

HTML-PDF Using Puppeteer In Node

I want to convert html to pdf. I have already tried phantomjs (which is giving timeout error all the time) and wkhtmltopdf (which is very slow,taking 10 mins to get downloaded) .

Now I tried puppeteer but I don't know how to do, first I tried installing puppeteer and its giving this error

ERROR: Failed to download Chromium r662092! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.

Can someone please help me to get over this html to pdf conversion

Ad

Answer

In your .npmrc file you have to add the below line to get rid of this error,

puppeteer_skip_chromium_download=true

Hope this helps!

Ad
source: stackoverflow.com
Ad