如何从一个Web应用程序做先进的印刷? [英] How do I do advanced printing from a web application?

查看:185
本文介绍了如何从一个Web应用程序做先进的印刷?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究通过一个Web应用程序打印报表,数据等选项。是可行的一些选项编写的PDF,XML的Excel,HTML倾倒到Excel,或者使用类似activePDF webGrabber的工具。我想的问题是,什么是一些解决方案,(对我来说IE)给控制打印从浏览器还没有一个庞大的开发时间。虽然我没有与它自己的经验,我已经看到了一些可怕的code生成PDF文件。

I have been researching options for printing report-like data via a web application. Some options that are viable are writing PDFs, Excel XML, dumping HTML to Excel, or using a tool like activePDF webGrabber. I suppose the question is, what are some solution that give control over print from a browser (IE in my case) yet doesn't have a huge development time. Though I don't have experience with it myself, I have seen some horrid code for generating PDFs.

我在寻找特别的功能是打印横向或纵向无需用户干预。此外,有超过基本造型的控制是非常重要的Web应用程序的基本外观/感觉转换为打印格式。

The features I'm looking for in particular are to print landscape or portrait without user intervention. Also, having control over basic styling is important to translate the basic look/feel of the web app to the printed format.

任何意见(特别是从经验)是AP preciated。

Any advice (especially from experience) is appreciated.

推荐答案

正如我问这里已经,并发现了艰辛的道路,你不会纯粹在浏览器中得到可靠和准确的印刷效果。即使是你已经答应只能用IE7工作的Intranet应用程序,IE8将很快出来,然后火狐将被允许和你的CSS仔细微操将是徒劳的(做我听起来苦?)。

As I've asked about here already and found out the hard way, you aren't going to get reliable and accurate printing results purely within the browser. Even if it is an intranet application that you've been promised must only work with IE7, IE8 will be out soon and then Firefox will be allowed and all of your careful micromanagement of CSS will be for naught (do I sound bitter?).

最前瞻性的解决方案是硬着头皮去生成PDF文件。你提到的工具都不错。你也应该看看 iText的并的 iTextSharp的。一旦你得到了它的窍门,做PDF布局并不比HTML和CSS的任何困难,你就会知道结果会正确打印大家的计算机,每个人的浏览器,大家的打印机。我目前正在与iTextSharp的(尚未完成,但仍然在学习和试验)。

The most forward looking solution is to bite the bullet and go for generating PDFs. The tools you mentioned are good. You should also look at iText and iTextSharp. Once you get the hang of it, doing the PDF layouts isn't any harder than HTML and CSS and you will know that the results will print correctly on everyone's computer, everyone's browser, and everyone's printer. I'm currently working with iTextSharp (not finished yet, but still learning and experimenting).

我还没有找到可靠的方法来控制从一个页面内的打印选项要么,所以依靠你的用户从纵向改为横向或设置或调整保证金或关闭打印页眉和页脚少了点从长远来看,工作 - 你最终会讨厌他们,当他们不能为自己创造更多的麻烦(或只是不)遵循指示

I haven't found reliable ways to control the print options from within a page either, so relying on your users to change from portrait to landscape or to set or adjust margins or turn off the print headers and footers just doesn't work in the long run - you'll end up annoying them and creating more headaches for yourself when they can't (or just don't) follow instructions.

相关问题侧栏是非常有用的。我看到从控制网页打印这些问题(两者的答案是金额:你不能):

The "Related Questions" sidebar is very useful. I saw these questions on controlling the printer from the web page (both with answers that amount to: "you can't"):

<一个href=\"http://stackoverflow.com/questions/37162/how-do-i-make-an-html-page-print-in-landscape-when-the-user-selects-print\">Programmatically选择横向打印

<一个href=\"http://stackoverflow.com/questions/206880/printing-to-a-specific-printer-from-a-web-app\">Printing具体的打印机

这篇关于如何从一个Web应用程序做先进的印刷?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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