直接从Windows应用程序进行UWP打印,而无需打开“打印"对话框 [英] UWP Printing from Windows app directly without bringing Print Dialog
问题描述
-
POS打印机仅支持Epson打印机吗?(与 https://msdn.microsoft.com/en-us/library/windows/apps相关/mt426652 )
如何在不显示打印对话框"的情况下直接将文档发送到打印机?
How to send a document directly to the printer without showing Print Dialog?
推荐答案
ESC/POS是由Epson创建的命令系统,广泛用于POS打印机系统,旨在通过提供通用性来避免不兼容的命令集.大多数现代打印机都支持ESC/POS.
ESC/POS is a command system created by Epson used across a wide range of POS printer systems, aimed at avoiding incompatible command sets by providing universal applicability. Most modern printers support ESC/POS.
所以,对于第一个问题,我认为答案是否定的.此 POS打印机 API可以用于所有打印机支持ESC/POS.请参考具有格式的Epson ESC/POS
So, for your first question, I think the answer is no. This POS printer API can be used for all the printers which support ESC/POS. Please refer to Epson ESC/POS with formatting.
对于第二个问题,使用 POS打印机
API,您可以在没有打印对话框"的情况下进行打印.
For your second question, using POS printer
API, you can print without a Print Dialog.
But I assume, what you want is Windows.Graphics.Printing namespace. For this printing in a UWP app, the Print Preview UI must be shown to guide user complete the printing operation.
更新2/1/2016:
使用POS打印机API,您可以在没有打印对话框的情况下进行打印.
using POS printer API, you can print without a Print Dialog.
@Seb,这是我个人的结论,POS打印机的正式文档未提及有关UI对话框的任何内容.
@Seb, this is my personal conclusion, the official document of POS printer doesn't mention anything about a UI dialog.
但是在文档和正式示例的简短示例中,当我们使用pos设备进行打印时,我们首先会创建一个打印作业,然后调用 ExecuteAsync 方法,此方法
But in the short sample in the document and official sample, when we print with a pos device, we create a print job at first, then call the PrintLine(string) method with the content which we want to print, at last, we execute it/them with ExecuteAsync method, this method
异步运行收据打印机工作站上的打印作业.
Runs the print job on the receipt printer station asynchronously.
在此过程中,我们不会显示任何对话框,这与常规打印不同.在常规打印中,当我们想从应用程序中打印文档时,我们称为
In this process, we don't show any dialog unlike in the normal printing. In the normal printing, when we want to print a document from our app, we call ShowPrintUIAsync() method, this method will show a dialog to provide guidance for users to help them complete a printing-related oricess.
@Hamed,如果没有ESC/POS,此Pos打印机API不能支持那些设备,我不确定是否可以通过串行端口向打印机发送命令并获得响应,我想您可以阅读开发打印机文档.
@Hamed, this Pos printer API can't support those device without ESC/POS, I'm not sure if it possible to send commands to your printer and get response from it through serial port, I think you may read the develop document of your printer.
这篇关于直接从Windows应用程序进行UWP打印,而无需打开“打印"对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!