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

rotated text by CSS cannot be captured by html2canvas #184

Closed
xiangcao opened this issue Mar 28, 2013 · 13 comments
Closed

rotated text by CSS cannot be captured by html2canvas #184

xiangcao opened this issue Mar 28, 2013 · 13 comments
Labels

Comments

@xiangcao
Copy link

I used css
.heading1 {
-moz-transform: rotate(270deg);
-webkit-transform: rotate(270deg) ;
-o-transform: rotate(270deg) ;
-ms-transform: rotate(270deg) ;
transform: rotate(270deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=4);
}
to display a rotated headline for a chart. then i use html2cavas to 'screenshot' the page, this rotated text cannot be proper displayed. It become a vertical text in which each letter is placed horizontally but aligned with each other vertically. and it looks ugly.

1
2

@niklasvh
Copy link
Owner

css transforms aren't supported yet

@xiangcao
Copy link
Author

thanks for replying. I then have to figure out another way to display that vertical text or display it horizontally instead.

@Jelle-S
Copy link

Jelle-S commented Apr 19, 2013

Any idea on when this will be supported. I kind of need this pretty bad (css3 matrix3d in particular)

@MaitreyJukar
Copy link

Try adding the text content into a span. It worked for me. Still don't know why though...

@luck2011
Copy link

@MaitreyJukar wrap text content into a span does not work for me, sad

@checking12
Copy link

Does anyone find any solution for rotated divs screenshot?

@jjoe64
Copy link

jjoe64 commented Oct 31, 2015

workaround:
http://www.jjoe64.com/2015/10/html2canvas-and-css-transform-rotate.html

@brcontainer
Copy link
Contributor

@jjoe64 #209 (comment)

@ffflabs
Copy link

ffflabs commented Nov 2, 2015

I'm displaying an infographic which contains images, charts and text. Since vertical text in the charts doesn't work, what I'm doing is using canvg to convert each of those charts (which are in c3 SVG) to a canvas, o even going one step further to convert said canvas to an image. This can be done recursively for any SVG group in the DOM.

@Drons2p
Copy link

Drons2p commented Aug 7, 2016

How i can save div with CSS transform: perspective ?

@zk7035
Copy link

zk7035 commented Oct 20, 2016

How i can save div with CSS -webkit-mask-box-image: url(http://kz-c2.qiniudn.com/a.svg); ?

@brcontainer
Copy link
Contributor

@zk7035 As each CSS property needs to be manually built to be supported, there are a number of properties that are not yet supported. (https://github.com/niklasvh/html2canvas#browser-compatibility)

Details: #246

@joseiriarte1982
Copy link

Rotate worked form me but with a span I used one of the answers above. Here is what I did in my style I put a class

.vertical {
position: absolute;
left: -50px;
top: 0px;
width: 120px;
height: 20px;
font-size:12px;
color:#333;
transform: rotate(270deg);
}

the in my element a div position inline styled relative and whithin the div a span with class vertical.

<div style="width:100%;float:left;text-align:left;height: 80px;margin-left:25px;border-left:1px solid #000;/*writing-mode: tb-rl;transform: rotate(-180deg);*/height: 100px;font-size:12px;position:relative;"><span class="vertical" style="top:20px;">Articulo No.</span></div>

Hope it helps someone, saludos

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

No branches or pull requests