如何使网页在所有浏览器/打印机上的打印效果完全相同? [英] How would I make a web page print exactly the same across all browsers/printers?

查看:166
本文介绍了如何使网页在所有浏览器/打印机上的打印效果完全相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我很确定这甚至不可能,但我有一个朋友,他的客户基本上是在乞求他对此的回答,所以我告诉他我会从这里的友好人士那里得到一些意见

Ok, so I'm pretty sure this isn't even possible, but I have a friend whose client is basically begging him for an answer on this so I told him I'd get some input from the friendly folks here at SO.

他的客户对跨所有浏览器(IE7+、FF、Chrome 和 Safari)的像素精确用户界面设计非常挑剔.他们有来自其他国家/地区的团队,他们只是坐在那里进行测量,以确保所有浏览器/版本(字体、所有内容之间的间距、边距等)中的所有内容都与他们的 UX 风格指南相匹配.

His client is ULTRA-PICKY about pixel precise user interface design across all browsers (IE7+, FF, Chrome and Safari). They have TEAMS of people in other countries who do nothing but sit there and measure to make sure everything matches their UX style guide down to the pixel in all browsers/versions (fonts, spacings between EVERYTHING, margins, etc).

话虽如此,他们的下一个要求是他们想要打印行车路线,但他们的用户体验要求对于打印来说同样严格.他们希望所有页面的边距完全相同,元素之间的间距相同等.换句话说,无论您使用哪种浏览器或打印机打印,打印输出都应该完全相同,精确到像素在(你不高兴这不是你的客户)?:)

Having said that, their next request is that they want to print driving directions but their UX requirements are just as stringent for printing. They want margins to be exactly the same on all pages, spacing between elements to be the same, etc. In other words, the printout should be EXACTLY the same, down to the pixel, no matter which browser you print from or printer you print on (aren't you glad this isn't your client)? :)

不,他们不想与 PDF 有任何关系,哈哈.

No, they want nothing to do with PDF, lol.

我的问题是:这甚至可能吗?如果可能,您能否指出一些我们可以查看的在线参考资料?根据默认设置,每台打印机的渲染效果不会有所不同吗?说到打印,这里不是有超出开发人员控制范围的事情吗?我和我的同事都没有被要求在不同的浏览器/打印机上创建如此精确的东西,所以我想我会在这里得到一些输入.

My question is: is this even possible? If it IS possible, can you point to some online references we can check out? Wouldn't each printer render things a bit differently based on default settings? Aren't there things outside the developer's control here when it comes to printing? Neither I nor my colleague have ever been asked to create something so precise across different browsers/printers so I though I'd get some input here.

推荐答案

将所有内容渲染为图像(因为您说没有 PDF)?

Render everything to an image (since you said no PDF)?

实际上,这是一个不合理的要求.您可以为不同的媒介创建样式,并使用 CSS 重置和 javascript 处理浏览器差异,但您将始终拥有不同的屏幕分辨率或屏幕类型(想到 eInk kindles)以及使用不同墨水或不同类型打印机的打印机.

In all reality, this is an unreasonable request. You can create styles for different mediums, and handle browser differences with CSS resets and javascript, but you will always have different screen resolutions or screen types (eInk kindles come to mind) and printers with different inks or different types of printers.

这篇关于如何使网页在所有浏览器/打印机上的打印效果完全相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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