niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.37k stars 4.79k forks source link

html2canvas in IE 10 + not capturing pseudo css elements #1683

Open JEEVANJGA opened 5 years ago

JEEVANJGA commented 5 years ago

Am using html2canvas as an npm package in a react project.

Am generating a tree like chart using custom css that has few pseudo elements. Ref : codepen

In chrome the connectors are not getting aligned in PDF as displayed in browser for single child scenarios. In IE 10+, pseudo elements for the connectors are not displayed at all in PDF as visible in IE. They seems getting hidden somehow.

Chrome Browser View: chrome_tree_browser_view

Chrome PDF View: chrome_tree_pdf_view

IE Browser View: ie_tree_browser_view

IE PDF View : ie_tree_pdf_view

I presume this is something with respect to Pseudo Css elements in IE and Chrome.

Solution with the sample code would be appreciated.

Thanks in advance.

Specifications:

JEEVANJGA commented 5 years ago

@niklasvh could you please help me out on this. Was hoping to get a solution for this issue.

Hope you would respond as early as possible.