Html2canvas: Clip-path css doens't render ?

Created on 2 Jun 2016  路  5Comments  路  Source: niklasvh/html2canvas

Hi,

I'm using various image genretated by CSS with some clip path such as:

.rec.one{
position: absolute;
float:left;
    -webkit-clip-path: polygon(0 0, 27% 26%, 27% 100%, 0% 100%);
clip-path:  polygon(0 0, 27% 26%, 27% 100%, 0% 100%);
}
<div class="rec one">

                 <img src="pattern/purple.jpg" height="500">

            </div>

The problem I'm having is when i render the canvas as an img, it render the full image ( not masked anymore via the clip path)

Is there anyway to make this work by any chance ? It would be incredible !

Thanks a lot!

Most helpful comment

is this actually resolved or not sorry?

All 5 comments

Is solved ?

I'm having the same issue except with background-color instead of an image (html2canvas 0.5.0-alpha1)

Use dom-to-image instead
https://github.com/tsayen/dom-to-image

It allows save image from DOM elements with clip-path css property.

Thank you so much. It is work for me. Actually it is not work for https://www.blabla.com/example.jpeg" so not render image url from another server.

is this actually resolved or not sorry?

Was this page helpful?
0 / 5 - 0 ratings