打印字节()数据而不显示vb.net中的打印对话框 [英] Printing Byte() data without showing print dialogue box in vb.net

查看:81
本文介绍了打印字节()数据而不显示vb.net中的打印对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi,
I have some byte data in an array.  I need to print it directly to the printer, without shoiwng print dialogue box.  Please give me code sample how to avoid the dialogue box.

Thanks

推荐答案

参见绝对新手的.NET打印指南 [ ^ ]



在.NET中打印非常接近打印系统的概述。您可以使用两个主要的框架类来完成打印的所有工作,它们位于System.Drawing.Printing命名空间中:PageSettings,用于选择纸张大小和页面方向,以及PrintDocument,它是用来做打印操作本身。



可以说,在.NET中实现自定义打印操作的最好方法是创建自己的类,其中包含一个私有变量是PrintDocument类型并编写代码以在该类的事件处理程序中执行打印以打印所需的文档。我将按照它们在打印操作的生命周期中的顺序进行讨论。
See An absolute beginner's guide to printing in .NET[^]

Printing in .NET follows the overview of the print system quite closely. There are two main framework classes that you use to do all your work with printing, which are in the System.Drawing.Printing namespace: PageSettings, which is used for such things as selecting the paper size and page orientation, and PrintDocument, which is used to do the printing operation itself.

Arguably, the best way of implementing a custom print operation in .NET is to create your own class that holds a private variable that is of type PrintDocument and write the code to perform the printing in the event handlers of that class to print the desired document. I will discuss these in the order in which they occur in the life of a print operation.


MS在此处有一些代码用于执行此操作 http://support.microsoft.com/kb/322090 [ ^ ]
MS has some code for doing that here http://support.microsoft.com/kb/322090[^]


这篇关于打印字节()数据而不显示vb.net中的打印对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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