Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我windows.print()在我的项目中使用打印页面。我使用 Css 来设置此页面的样式以删除正文边距和填充。但是像 IE 这样的浏览器在打印设置中有默认边距。如何删除所有这些边距?我想用整页打印
windows.print()
我认为如果没有某种 ActiveX 交易,您将无法做到。不久前我尝试过同样的事情,但这是不可能的,因为这些设置只能从用户的计算机更改,而网页脚本无法访问。我能想到的唯一选择是使用 TCPDF 或其他东西生成 PDF;这样你就可以让它完全按照你的意愿打印。