打印网页的像素安全宽度? [英] Safe Width in Pixel for Printing Web Pages?

查看:205
本文介绍了打印网页的像素安全宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

打印网页时,以像素为单位的安全宽度是多少?

What is the safe width in pixel to print a web page?

我的网页包含大图片,我想确保在打印时不会被剪切。

My page includes large images and I want to make sure they will not be cut of when printed.

我知道不同的浏览器边距和美国Letter / DIN A4纸张尺寸。所以我们得到标准的信件大小和一些默认的DPI值。但是我可以将它们转换为像素值,以在图片的 width 属性中指定?

I know about different browser margins and US Letter / DIN A4 paper sizes. So we got standard letter sized and some default DPI values. But can I convert these into pixel values to specify in the image's "width" attribute?

推荐答案

至于一个真正的普遍答案,我不能提供一个。

As for a true "universal answer", I can’t provide one. I can, however, provide a simple and definitive answer for some particulars...



670 PIXELS p>

670 PIXELS


至少这似乎是Microsoft产品的安全答案。我读了很多建议,包括675,但是测试完后,我自己670是我想出来的。

At least this seems to be a safe answer for Microsoft products. I read many suggestions, including 675, but after testing this myself 670 is what I came up with up.

所有的DPI,保证金问题,硬件差异,是基于这样的事实,如果我在IE9(使用标准边距)使用打印预览 - 并将打印尺寸设置为100%,而不是默认的收缩适合,一切适合在页面上,而不会被切断在这个宽度

All the DPI, margin issues, hardware differences aside, this answer is based on the fact that if I use print preview in IE9 (with standard margins) – and SET THE PRINT SIZE TO 100% rather than the default of "shrink to fit", everything fits on the page without getting cut off at this width.

如果我发送一封HTML电子邮件给自己,并收到它与Windows Live Mail 2011(什么Outlook Express成为),我打印的页面在670宽度 - 一切都符合。如果我将它发送到实际的硬拷贝或MS XPS文件(虚拟打印输出),这是真的。

If I send an HTML email to myself and receive it with Windows Live Mail 2011 (what Outlook Express became) and I print the page at 670 width – again everything fits. This holds true if I send it to an actual hard copy or a an MS XPS file (virtual printout).

在我试验之前,我使用任意宽度700 。在上面提到的所有情况下,页面的一部分被切断。当我减少到670,一切都很完美。

Before I experimented, I was using a arbitrary width of 700. In all the scenarios mentioned above part of the page was getting cut off. When I reduced to 670, everything fit perfectly.

至于如何设置宽度 - 我只是使用一个原始wrapperhtml表,并将其宽度定义为670 。

As for how I set the width – I just used a primitive "wrapper" html table and defined it’s width to be 670.

如果你可以决定最终用户的软件,这样的事情可以直截了当。如果你不能(当然通常是这种情况),你可以测试的细节,如他们正在使用的浏览器等,并硬编码解决方案的重要。在IE和FF之间,你将覆盖大约90%的网络用户。放入一些其他代码为其他人,这通常似乎工作,称为一天...

If you can dictate the end user’s software, such matters can be straight forward. If you cannot (as is usually the case of course) you can test for particulars like which browsers they are using, etc. and hardcode the solutions for the important ones. Between IE and FF, you will cover literally about 90% of web users. Put in some other code for "everyone else" which generally seems to work and call it a day...

这篇关于打印网页的像素安全宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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