问题描述
我目前正在制作一个项目,我需要在收据打印机上打印收据。
目前我使用CSS机制media = screen,media = print来指示要打印的内容。
I'm currently making a project where I need to print out a receipt on a receipt printer.At the moment i'm using the CSS mechanism media=screen , media=print to indicate what to print.
问题是当然是页眉和页脚无法删除,因为它是客户端浏览器特定的。
Problem is of course the header and footer which can't be removed, as it is client browser specific.
所以我想知道是否有人有关于如何做打印的另一个建议。
So i'm wondering if anyone has another suggestion on how to do the printing. Preferbly without using too much IO.
推荐答案
一般来说,如果你需要精确的控制,你最好的办法是有一个pdf,或从服务器生成的其他文档格式,供您打印。 (如果机器打印收据是受控制的,并且有.doc(html与输出类型)是最简单的方法。有许多第三方控件从服务器端代码生成PDF希望这个lead
Generally speaking, if you need precise control, your best bet is to have a pdf, or other doocument format that is generated from the server, for your printing. (if the machines printing receipts are controlled, and have word, than .doc (html with an output type) is the easiest method. There are a number of third party controls for generating PDF from server-side code as well. Hope this leads you in a usable direction, since you didn't specify if you controlled the client machines in use.
PDF的一个好处是你可以将它作为一个硬盘使用,以及能够将收据作为附件发送电子邮件。
One benefit to PDF is you can use it as a hard archive, as well as being able to email receipts as an attachment.
这篇关于打印收据ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!