Send a .pdf file to a specific printer


I am writing an application in 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

            psi.UseShellExecute = True
            psi.Verb = "print"
            psi.WindowStyle = ProcessWindowStyle.Hidden
            psi.Arguments = strPrinterName
            psi.FileName = strFile

            Return "OK"
        Catch ex As Exception
            Return ex.Message
            psi = Nothing
        End Try
    End Function


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
I had to do it a while ago. I ended up setting the required printer as the default one (and reverting it after the print). Check
ross13Author Commented:
I spent a lot of time on this and found some software called PDFxchange. This is a free bit of software that you can call from the command line and you can pass the name of the printer that you are sending the print to.

Best regards,


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ross13Author Commented:
I can run multiple applications on the same PC without having to swap the default printer. Running multiple applications this was could possibly create a problem.  The solution I used for my project is to use third party software.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.