在打印html时选择页面范围(Option for page range while printing html)

编程入门 行业动态 更新时间:2024-10-27 03:32:53
在打印html时选择页面范围(Option for page range while printing html)

如果我有1000页的HTML可以提供页面范围选项,同时打印HTML? 在JavaScript中可能吗? (例如:打印页面100至200)

If i have 1000 pages of html can i provide option for page range while printing html? Is it possible in javascript? (Ex: print page 100 to 200)

最满意答案

将页面范围传递给本地打印对话框......不行。

您可以动态地使用您在打印样式表中定义的CSS类来打印您不想打印的部分...

<link rel="stylesheet" type="text/css" media="print" href="print.css" /> /* contents of print.css */ .noprint { display: none; }

在调用window.print()之前,您必须弄清楚如何将该类放到HTML的相应位上。

Passing in a page range to the native print dialog... nope.

You could dynamically wrap the portions that you don't want to print with a CSS class that you've defined in a print stylesheet...

<link rel="stylesheet" type="text/css" media="print" href="print.css" /> /* contents of print.css */ .noprint { display: none; }

You'll have to figure out how to get that class onto the appropriate bits of HTML before calling window.print().

更多推荐

html,页面,打印,page,HTML,电脑培训,计算机培训,IT培训"/> <meta name="descript

本文发布于:2023-07-05 06:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034334.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   Option   html   printing   range

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!