【发布时间】:2017-11-26 18:31:38
【问题描述】:
我必须选择一台打印机并打印一个 PDF 文件。 我在这里使用,此代码仅在默认打印机中打印.. 我厌倦了搜索,但没有找到解决方案。
Dim PrintPDF As New ProcessStartInfo
PrintPDF.UseShellExecute = True
PrintPDF.Verb = "print"
PrintPDF.WindowStyle = ProcessWindowStyle.Hidden
PrintPDF.FileName = "temp.pdf" 'fileName is a string parameter
Process.Start(PrintPDF)
我已经完成了另一部分来在下拉列表中查找打印机 此代码用于查找打印机
Dim pkInstalledPrinters As String
For Each pkInstalledPrinters In PrinterSettings.InstalledPrinters
ComboBox1.Items.Add(pkInstalledPrinters)
Next pkInstalledPrinters
ComboBox1.SelectedIndex = ComboBox1.Items.Count - 1
有什么建议吗? 谢谢。
【问题讨论】: