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?
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
andheight
property ofdom-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?