通过print.css文件调整pdf大小/缩放画布

时间:2016-03-14 15:54:43

标签: javascript html css html5 canvas

将网站保存为pdf(phantomjs)时,我在我的print css文件中指定我的画布应该是100%宽度高度。

canvas {
   max-width: 100%!important;
   max-height: 100%!important;
}

然而在pdf中,它的缩放错误并且看起来很紧张。 从阅读各种帖子我了解到,在画布的css中设置高度/宽度attr是不行的,你必须直接在canvas标签中指定它。 来源:https://www.kirupa.com/html5/resizing_html_canvas_element.htm

我如何处理这个以获得我的pdf格式的正确画布?

0 个答案:

没有答案
相关问题