mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
docs: improve canvas size limit documentation (#1576)
This commit is contained in:
parent
349bbf137a
commit
3212184146
10
docs/faq.md
10
docs/faq.md
@ -13,8 +13,14 @@ methods to check whether an image would taint the canvas before applying it. If
|
|||||||
If you wish to load images that reside outside of your pages origin, you can use a [proxy](/proxy) to load the images.
|
If you wish to load images that reside outside of your pages origin, you can use a [proxy](/proxy) to load the images.
|
||||||
|
|
||||||
## Why is the produced canvas empty or cuts off half way through?
|
## Why is the produced canvas empty or cuts off half way through?
|
||||||
Make sure that `canvas` element doesn't hit [browser limitations](https://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element) for the `canvas` size.
|
Make sure that `canvas` element doesn't hit [browser limitations](https://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element) for the `canvas` size or use the window configuration options to set a custom window size based on the `canvas` element:
|
||||||
The limitations vary by browser, operating system and system hardware.
|
```
|
||||||
|
await html2canvas(element, {
|
||||||
|
windowWidth: element.scrollWidth,
|
||||||
|
windowHeight: element.scrollHeight
|
||||||
|
});
|
||||||
|
```
|
||||||
|
The window limitations vary by browser, operating system and system hardware.
|
||||||
|
|
||||||
### Chrome
|
### Chrome
|
||||||
> Maximum height/width: 32,767 pixels
|
> Maximum height/width: 32,767 pixels
|
||||||
|
Loading…
Reference in New Issue
Block a user