使用window.print()?
时,有什么方法可以添加打印参数答案 0 :(得分:0)
您可以使用CSS3规则:
@page {
size: A4 portrait;
margin: 27mm 16mm 27mm 16mm;
counter-increment: page;
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
}
}
但是有些用户代理不支持pages
计数器,并且会忽略包含该计数器的任何内容,因此要覆盖所有UA,请执行以下操作:
@page {
size: A4 portrait;
margin: 27mm 16mm 27mm 16mm;
counter-increment: page;
@bottom-right {
content: "Page " counter(page);
content: "Page " counter(page) " of " counter(pages);
}
}
详细了解CSS3分页媒体模块here