选择打印机以在vb.net中打印PDF文件
我必须选择打印机并打印PDF文件。 这里我使用,此代码仅在默认打印机中打印。。我找累了,没有找到解决办法选择打印机以在vb.net中打印PDF文件,vb.net,pdf,printing,Vb.net,Pdf,Printing,我必须选择打印机并打印PDF文件。 这里我使用,此代码仅在默认打印机中打印。。我找累了,没有找到解决办法 Dim PrintPDF As New ProcessStartInfo PrintPDF.UseShellExecute = True PrintPDF.Verb = "print" PrintPDF.WindowStyle = ProcessWindowStyle.Hidden PrintPDF.FileName = "temp.pdf" 'fil
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
有什么建议吗?
谢谢。试试这个
我在表单中添加了一个web浏览器控件。
添加pdf文件名的文件名,如下所示:
WebBrowser1.naviagte(您的文件名)
试一试
WebBrowser1.Print()
特例
MsgBox(例如消息)
结束尝试
执行此操作时,您的应用程序会显示带有内置选项的“打印”对话框,您需要使用哪台打印机进行打印。试试这个
我在表单中添加了一个web浏览器控件。
添加pdf文件名的文件名,如下所示:
WebBrowser1.naviagte(您的文件名)
试一试
WebBrowser1.Print()
特例
MsgBox(例如消息)
结束尝试
执行此操作时,您的应用程序会显示带有内置选项的打印对话框,您需要使用哪个打印机进行打印。''拼写错误:WebBrowser1.navigate(YourFileName)''拼写错误:WebBrowser1.navigate(YourFileName)