0

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

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

8 Comments

Thank you sir , It worked . I am new to this puppeteer, Can you guide me, how to use this with node
@Wolverine Glad that it worked!. Here is a step-by-step tutorial which you can follow => blog.risingstack.com/pdf-from-html-node-js-puppeteer
But when trying to reload the website I am getting this error --> Error: Chromium revision is not downloaded. Run "npm install" or "yarn install" , On the website how can i solve this problem?
What happens when you do a npm install ?
It skipped Chromium Download --> INFO Skipping Chromium download. "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" was set in npm config. That's why it's giving the above error. how to solve that ?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.