Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update faq.md - Why is the produced canvas empty or cuts off half way through? #1576

Merged
merged 1 commit into from
Apr 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## 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.
The limitations vary by browser, operating system and system hardware.
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:
```
await html2canvas(element, {
windowWidth: element.scrollWidth,
windowHeight: element.scrollHeight
});
```
The window limitations vary by browser, operating system and system hardware.

### Chrome
> Maximum height/width: 32,767 pixels
Expand Down