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

Offscreen parts on scrollable page are black #590

Closed
nosbabananos opened this issue May 19, 2015 · 7 comments
Closed

Offscreen parts on scrollable page are black #590

nosbabananos opened this issue May 19, 2015 · 7 comments

Comments

@nosbabananos
Copy link

Hi everyone,

I'm developing angular.js app which is using chart.js for charts and I need to export charts to image.

I use html2canvas on a div which contains charts and it works fine for me when all of the charts are visible within a window. But, when charts cannot fit on a window, offscreen parts of div are black after in an image file. I googled and googled and I can find a solution. Any sugestion?

@dhustlerz
Copy link

Hi ,
I have the similar issue .
+1

@ufologist
Copy link

ufologist commented May 31, 2016

I have the similar issue too, and I found a way to fix it.
Please see example below, perhaps help you.

html2canvas snapshot invisible DOM in a scrollable div
html2canvas-snapshot-invisible.html

blog: fix html2canvas snapshot invisible DOM Chinese

@Chima1707
Copy link

Chima1707 commented Jun 30, 2016

@ufologist, dont you have an English version of your block?

@shohoku11wrj
Copy link

This thread has two solutions: 1. fix source code; 2. workaround without touching source. #461

@kkxlkkxllb
Copy link

      $el = $htmlEl.clone().css
        position: 'fixed'
        top: 0
        left: 0
        padding: 0
        height: 'auto'
      $el.appendTo $('body')
      ow = $htmlEl[0].clientWidth
      w = $el[0].clientWidth
      if w > ow
        w = ow
        $el.css
          width: w
      h = $el[0].clientHeight
      html2canvas $el

clone your element to body, set some css to calculate width and height

@niklasvh
Copy link
Owner

Is this still an issue with v1.0.0? If so, could you please share an example on jsfiddle.

@no-response no-response bot closed this as completed Dec 12, 2017
@no-response
Copy link

no-response bot commented Dec 12, 2017

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants