1

I've seen other questions as well but all of them sugests a paid api or HTML2Canvas.

They are working methods but I don't want to pay for it and HTML2Canvas is not rendering all CSS.

See the difference :-

See [captured by chrome dev tools] :- chrome

See [captured by html2canvas] :- html2canvas

See [original captured by windows snipping tool] :- offline screenshot (see background blur and text color difference)

Is there any tested working method which can render all css and convert html to image with all blurs and color difference

Thank You in advance for Answering

1 Answer 1

1

Try Google Chrome in "headless" mode , save page to PDF... and look at the generated/embedded images.

outfile="myfile.pdf"
google-chrome --headless --print-to-pdf  https://mypage.io
mv output.pdf $outfile

I think option --screenshot is also available.

1
  • I'm looking for converting a Part of HTML such as a div into image Sep 27, 2022 at 9:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.