如何打印xps文件而不显示“打印”对话框 [英] how to print xps file without showing Print Dialog

查看:436
本文介绍了如何打印xps文件而不显示“打印”对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人可以提供我的代码可以打印XPS文件而无需打印对话框弹出窗口?

我想要做的是允许用户点击Windows WPf按钮直接发送到打印机而不选择打印机和页面大小。

谢谢!


mulder

Is anyone can provide me the code can print a XPS file without the Print Dialog popup?

What i want to do it's allow user click a windows WPf button and send to printer directly without choose printer and page size.

Thanks!


mulder

推荐答案

嗨Szmulder,
看看这个样品:  http://msdn.microsoft.com/en-us/library/ms771685.aspx 。  此示例将向您展示如何迭代系统可用的所有打印队列。 一旦找到要打印到的队列,就可以使用PrintQueue对象的AddJob(作业名称,XPS文档,验证XPS文档)方法进行打印而无需打印对话框。

希望有所帮助。

干杯,
Lucas [MSFT]
Hi Szmulder,
check out this sample:  http://msdn.microsoft.com/en-us/library/ms771685.aspx.  This sample will show you how to iterate over all the print queues available to the system.  Once you find the queue that you want to print to, you can use the PrintQueue object's AddJob(Job Name, XPS Document, Validate XPS document) method to print without the print dialog.

Hope that helps.

Cheers,
Lucas [MSFT]


这篇关于如何打印xps文件而不显示“打印”对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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