I am trying to select a printer before printing a PDF file using PDF-XChange Viewer. I have modified the sample app and this works when I use the locally-named printer on my computer. However, if I try use the IP address of the printer, I get an "Invaid pages range" error. This is my current code:
Code: Select all
'Set printer name
Try
Dim bsVerb As String = "Print.PrinterName"
Dim vDataIn As String = ""
'vDataIn = "OFFICEPRINTER1" 'This works
vDataIn = "http://172.100.2.67" 'This causes an "Invalid pages range" error.
AxCoPDFXCview1.SetProperty(bsVerb, vDataIn, 0)
Catch ex As Exception
MsgBox("Error setting PrinterName: [" & ex.Message.ToString & "]")
End Try
I had to add the "http://" to the address, or it came back with an "invalid printer name" error. I am attempting to develop this so that any user of my app can print to
any network printer (even if that printer is not installed locally on their computer). Printer names can vary on each computer, so I thought using the IP address might be a better method. Other than this problem, the XChange Viewer is handling all of my issues and I am looking forward to implementing this ASAP.
Please let me know if you need further details. I would appreciate any suggestions anyonce could give me!
Thanks,
Karl