0

I Need to print a pdf file to a selected printer.

I have tried using the code below, but it opens adobe and prints to the default printer. Does itext 7 have the ability to print directly to a selected printer using the print dialog box.

I am using visual basic.net

    Dim proc As Process = New Process
        proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
        proc.StartInfo.Verb = "print"
        'Define location of adobe reader/command line
        'switches to launch adobe in "print" mode
        proc.StartInfo.FileName = "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
        proc.StartInfo.Arguments = "/p /h "" " & item & ""
        proc.StartInfo.UseShellExecute = False
        proc.StartInfo.CreateNoWindow = False
        proc.Start()
        proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal
        If (proc.HasExited = False) Then
            proc.WaitForExit(10000)
        End If

        proc.EnableRaisingEvents = True
        proc.Close()
        killProcess("AcroRd32")
Michael
  • 1
  • 5

0 Answers0