开发者

Zoom page while printing in javascript

开发者 https://www.devze.com 2023-03-10 07:02 出处:网络
Hi I am taking print as Landscape in javascript, as there was no standard code, so i changed it to like that i rotate my page div to 90 degree, which makes it landscape way and then perform window.pri

Hi I am taking print as Landscape in javascript, as there was no standard code, so i changed it to like that i rotate my page div to 90 degree, which makes it landscape way and then perform window.print(), but the problem is, i开发者_如何学Go made it fool as basically it is PORTRAIT printing in landscape way, so the text is quite small, and fields also, i want that they should be zoomed, so is there anyway to zoom the page for printing.

Thanks Atif


Use a stylesheet specifically for printing

<link rel="stylesheet" media="print" href="print.css"/>

or media queries

@media print {
  body { font-size: 10pt }
}
@media screen {
  body { font-size: 13px }
}
@media screen, print {
  body { line-height: 1.2 }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消