Firefox printing cuts canvas on end of first page, how do I make it not do that?

非 Y 不嫁゛ 提交于 2019-12-21 17:32:47

问题


http://fiddle.jshell.net/bTtKT/show/

If I print the above page in Chrome as A4 Landscape I get two pages as expected given the size of the canvas on the page, if I do the same in Firefox however (with print preview for example), it gives me only one page and therefor cuts the image/canvas in half. If I change the scale in Firefox however I do start to see the whole image (but then it's too small), so the image is there as a whole but Firefox seams to ignore that its bigger then one page for some reason.

How do I get Firefox to recognize that the image needs more then one page so I can print the whole thing in correct size?

(possible to edit the above page example here: http://jsfiddle.net/bTtKT/ )


回答1:


I didn't try it out, but you could try:

canvas { page-break-inside: avoid; } 

See: https://developer.mozilla.org/en/CSS/page-break-inside




回答2:


Putting this style on the div encompassing the canvas might help ya:

page-break-inside: avoid
clear: both
float: none


来源:https://stackoverflow.com/questions/10350688/firefox-printing-cuts-canvas-on-end-of-first-page-how-do-i-make-it-not-do-that

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!