tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.21k stars 1.68k forks source link

Generate Images how they would look on desktop #389

Open 16flotho opened 2 years ago

16flotho commented 2 years ago

I am using dom-to-image im my React-App to generate images for a PDF. If I'm using my website on desktop, the images are generated perfectly, but on mobile, the components aren't the same size as on desktop. This causes that my PDF gets generated wrong. I want the PDF to look exactly the same as on desktop.

I tried using the width and height property of dom-to-image. This works for the size of the components, but inside the components are also text and images, styled with flexbox. These children look like on mobile.

Can I somehow reapply all styles of components and children or is there another possibility?