{"componentChunkName":"component---src-templates-docs-js","path":"/faq/","result":{"data":{"markdownRemark":{"html":"

Why aren't my images rendered?

\n

html2canvas does not get around content policy restrictions set by your browser. Drawing images that reside outside of\nthe origin of the current page taint the\ncanvas that they are drawn upon. If the canvas gets tainted, it cannot be read anymore. As such, html2canvas implements\nmethods to check whether an image would taint the canvas before applying it. If you have set the allowTaint\noption to false, it will not draw the image.

\n

If you wish to load images that reside outside of your pages origin, you can use a proxy to load the images.

\n

Why is the produced canvas empty or cuts off half way through?

\n

Make sure that canvas element doesn't hit browser limitations for the canvas size or use the window configuration options to set a custom window size based on the canvas element:

\n
await html2canvas(element, {\n    windowWidth: element.scrollWidth,\n    windowHeight: element.scrollHeight\n});
\n

The window limitations vary by browser, operating system and system hardware.

\n

Chrome

\n
\n

Maximum height/width: 32,767 pixels\nMaximum area: 268,435,456 pixels (e.g., 16,384 x 16,384)

\n
\n

Firefox

\n
\n

Maximum height/width: 32,767 pixels\nMaximum area: 472,907,776 pixels (e.g., 22,528 x 20,992)

\n
\n

Internet Explorer

\n
\n

Maximum height/width: 8,192 pixels\nMaximum area: N/A

\n
\n

iOS

\n
\n

The maximum size for a canvas element is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM

\n
\n

Why doesn't CSS property X render correctly or only partially?

\n

As each CSS property needs to be manually coded to render correctly, html2canvas will never have full CSS support.\nThe library tries to support the most commonly used CSS properties to the extent that it can. If some CSS property\nis missing or incomplete and you feel that it should be part of the library, create test cases for it and a new issue for it.

\n

How do I get html2canvas to work in a browser extension?

\n

You shouldn't use html2canvas in a browser extension. Most browsers have native support for capturing screenshots from\ntabs within extensions. Relevant information for Chrome and\nFirefox.

","frontmatter":{"title":"FAQ","description":"Explore Frequently Asked Questions regarding html2canvas","previousUrl":null,"previousTitle":null,"nextUrl":null,"nextTitle":null}}},"pageContext":{"slug":"/faq/"}},"staticQueryHashes":[]}