I am printing PDF files like this. It works fine for most of my printers:
Public Sub PrintFile(ByVal uPath As String, ByVal uPrinter As String)
Dim psi As New ProcessStartInfo
psi.WindowStyle = ProcessWindowStyle.Normal
psi.Verb = "printto"
psi.Arguments = uPrinter
psi.CreateNoWindow = False
psi.FileName = uPath
Dim nProc As New Process
nProc.StartInfo = psi
nProc.Start()
If nProc Is Nothing Then
MsgBox("failed!!!")
End If
DoSleep(3000)
Do While Not modEnvironment.IsPrinterQueueEmpty()
DoSleep(2000)
Loop
Try
nProc.CloseMainWindow()
Catch ex As Exception
Debug.Assert(False)
End Try
nProc.Close()
End Sub
This works fine for some printers.
For one printer, it does not work. The name I have given it is
"Canon MB2700 series Printer Wifi"
As one can guess, it's a Wifi printer. But I am not aware that Wifi printers have to be treated differently than locally connected printers.
There is no obvious error thrown or different process ExitCode, it just does not print.
I have compared the printer names again and again, I do not see any obvious spelling mistake or so.
That is why I would like to ask how I could debug what goes wrong in this case.
Thank you!