如何使用带代码的非默认打印机打印 PDF (VB Net) [英] How to print PDF with Not default printer with code (VB Net)
本文介绍了如何使用带代码的非默认打印机打印 PDF (VB Net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试打印 pdf 文件,使用默认打印机打印它没有问题,但是当我想使用辅助打印机打印时,它仍然使用默认打印机打印.
I´m trying to print a pdf file, there is no problem to print it with the default printer but when I want to do it with a secondary printer it still printing with the default one.
这是我的代码:
Dim MyProcess As New Process
MyProcess.StartInfo.CreateNoWindow = False
MyProcess.StartInfo.Verb = "print"
'HERE IS WHERE I WANT TO CHANGE THE PRINTER (BUT THIS COMMAND IS IGNORED)
MyProcess.StartInfo.Arguments = "Canon MG3500 series"
MyProcess.StartInfo.UseShellExecute = True
MyProcess.StartInfo.FileName = My.Application.Info.DirectoryPath & "\Copias digitales\Temp.pdf"
MyProcess.Start()
MyProcess.WaitForExit(10000)
MyProcess.CloseMainWindow()
MyProcess.Close()
我该怎么做?
谢谢大家.
推荐答案
我找到了用以下方法替换坏行的解决方案:
I found the solution replacing the bad line with:
Shell(String.Format("rundll32 printui.dll,PrintUIEntry /y /n ""{0}""", "Printer name"))
这篇关于如何使用带代码的非默认打印机打印 PDF (VB Net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文