When I try to use a network printer (ex. \\srvdc1\dell-3115) with GdViewer/GdPictureImaging, the function SetActivePrinter return a false value. I can't define my network printer and GdPicture use a default local printer. I dont wan't to declare my network printer in windows, but use the network path directly to print.
GdViewer viewer = new GdViewer();
string printer = @"\\SRVDC1\dell-3115";
bool result = viewer.SetActivePrinter(printer);
Is it a problem ?
Are you sure to enter to correct name ?
here a basic test to see what printer are reachable and to make a test of connection:
Code: Select all
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For i As Integer = 1 To oGdPictureImaging.PrintGetPrintersCount MsgBox("Next selection is: " + oGdPictureImaging.PrintGetPrinterName(i)) MsgBox(Imaging1.PrintSetActivePrinter(oGdPictureImaging.PrintGetPrinterName(i))) Next End Sub
Hope this helps.
Your code only give me the printers available on the local machine, even if some of these are plugged on a network. You can have the same list in the "Printers and Faxes" Windows menu.
Our previous component used by my company can print a document on a network or local printer, even if the printer is not added on the local machine, in my case a Windows 2003 Server.
I test several times but the fact is GdPicture can't reach a network printer if we don't have a reference in "Printers and Faxes".
I don't want to add each printer I want to use for printing but used directly its network path to launch printing process.
I hope you understand my problem.
I understand you better. Unfortunately, GdPicture.NET works only with printer (local or network) which are declared on the computer.
Who is online
Users browsing this forum: No registered users and 2 guests