ross13
asked on
Send a .pdf file to a specific printer
Hi,
I am writing an application in vb.net and need to send a pdf file to a specific printer.
I have been trying the following but it sends the pdf to my default printer?
Public Function printFile(strFile As String, strPrinterName As String)
Dim psi As New ProcessStartInfo
Try
psi.UseShellExecute = True
psi.Verb = "print"
psi.WindowStyle = ProcessWindowStyle.Hidden
psi.Arguments = strPrinterName
psi.FileName = strFile
Process.Start(psi)
Return "OK"
Catch ex As Exception
Return ex.Message
Finally
psi = Nothing
End Try
End Function
Regards,
Ross
I am writing an application in vb.net and need to send a pdf file to a specific printer.
I have been trying the following but it sends the pdf to my default printer?
Public Function printFile(strFile As String, strPrinterName As String)
Dim psi As New ProcessStartInfo
Try
psi.UseShellExecute = True
psi.Verb = "print"
psi.WindowStyle = ProcessWindowStyle.Hidden
psi.Arguments = strPrinterName
psi.FileName = strFile
Process.Start(psi)
Return "OK"
Catch ex As Exception
Return ex.Message
Finally
psi = Nothing
End Try
End Function
Regards,
Ross
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER