如何以300 dpi分辨率打印html页面 [英] How can i print html page at 300 dpi resolution

查看:2288
本文介绍了如何以300 dpi分辨率打印html页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个以html和css编码的网页。
网页的大小是A4页面(300dpi)= 2480 X 3508(PX)。

i have a web page that encoded in html and css. the size of the web page is of A4 Page (300dpi) = 2480 X 3508 (PX).

问题是,当我打印我的网页它以72 / 96dpi分辨率打印,打印7页而不是1,我想打印机将以300dpi分辨率打印我的网页。

the problem is that when i print my web page it's printing in 72/96dpi resolution and print 7 pages instead of 1, and i want that the printer will print my web page in 300dpi resolution.

HTML,JAVASCRIPT或可以帮助我的东西。

some code in CSS, HTML, JAVASCRIPT or something that can help me?

感谢。

推荐答案

p> HTML / CSS是矢量图形。你有css测量单位px(它总是72ppi,因此可能有点误导),但它不是实际的光栅图形 - 它应该希望像打印机软件矢量。如果你发现行,文本和这样打印在72dpi,你可以很确定的问题是你的打印机/渲染软件。

HTML/CSS are vector graphics. You have the css measurement unit "px" (which is always 72ppi and might therefore be a bit misleading) but it's not actually raster graphics - and it should hopefully be treated like vectors by the printer software. If you find lines, text and such printed in 72dpi you can be pretty sure the problem is your printer/renderer software. Try another browser or save it to PDF first (I know Chrome can do that natively).

由于CSS测量单位px,因此请先尝试其他浏览器或将其保存为PDF是72ppi,则光栅图形(= png,jpg和gif图像)始终被视为72ppi - 即使它们以另一种分辨率保存。但你可以通过调整大小来强制图像到所需的分辨率。如果我有一张图像 5x5厘米 = 2x2英寸),我需要将其保存为 600x600px ,但将其CSS width属性设置为 144px (这是 width *(72/300)),使它看起来像5厘米在网站上。

However since the CSS measurement unit "px" is 72ppi, raster graphics (=png, jpg and gif images) are always treated as 72ppi - even if they are saved in another resolution. But you can force images to the desired resolution by resizing them. If I have an image that's 5x5 centimeters (=2x2 inches) I need to save it as 600x600px, but set its CSS width property to 144px (which is width*(72/300)) to make it look like 5 centimeters on the website.

如果图像调整为适当的分辨率,你应该能够打印它在300dpi任何问题 - 特别是如果你先将其保存为pdf。否则很可能是打印机/打印机软件。

If the images are resized to the proper resolution you should be able to print it at 300dpi without any problems - especially if you save it to a pdf first. Otherwise it's most likely the printer/printer software.

请记住,网络不是打印的,网页不能看起来完全相同的屏幕和打印 - 这是整个点。如果这是你正在寻找你应该用PDF代替。

Keep in mind that web is not print and a webpage can't be expected to look exactly alike on screen and print - and that's the whole point.If that's what you're looking for you should just go with PDF instead.

这篇关于如何以300 dpi分辨率打印html页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆