Html 打印页面分辨率(或像素大小)
有谁知道用于渲染打印 HTML 页面的分辨率是多少。我想知道 500x500 像素的打印图像的尺寸(以厘米或英寸为单位)。我知道如果我设置缩放值(IE 和 FF),这个值会改变,但我对默认值感兴趣(当缩放为 100% 时)。
另外,有没有办法通过 CSS 控制这个分辨率?
谢谢
Does anybody know what is the resolution that will be used to render a printed HTML page. I'd like to know what size (in centimeters or inches) will be a printed image of say 500x500pixels. I know this value will change if I set the zoom value (IE and FF), but I am interested in the default value (when zoom is at 100%).
Also, is there any way of controlling this resolution from CSS?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
72ppi 或 96ppi,具体取决于操作系统/浏览器的组合。利润率也是一个问题。
如果这是针对有登录用户的网站,请让他们设置分辨率,或尝试从浏览器中猜测。请记住,任何人都可以在其计算机上更改此设置。
either 72ppi or 96ppi, depending on combination of OS/browser. Margins are an issue too.
If this is for a site with login users, get them to set their resolution, or try to guess from the browser. Remember that anyone can change this setting on their computer.
我认为您可以控制打印页面的尺寸,但不能控制分辨率。对于打印 CSS,相关尺寸单位包括
I think you can control the size, but not the resolution, of the printed page. Relevant units of size, for print css, would include
计算很简单:
对于 96dpi,您需要将宽度和高度(以英寸为单位)乘以 96(1 英寸 = 96dpi)。
例如,A4(8.5 英寸 x 11 英寸)将以 96dpi 打印:
96 * 8.5 = 816,
96 * 11 = 1056。
A4 96dpi 页面的分辨率为 816px x 1056px。
The calculation is simple:
With 96dpi you need to multiply 96 to the width and height in inches (1in = 96dpi).
For example, A4 (8.5in x 11in) will be printed with 96dpi:
96 * 8.5 = 816,
96 * 11 = 1056.
The resolution of the A4 96dpi page is 816px x 1056px.