Take the following steps to create and run a program that installs a LEADTOOLS Network Client Printer.
- Start Visual Studio .NET.
- Choose File-> New-> Project... from the menu.
- In the New Project dialog box, choose either "Visual C# Projects" or "Visual Basic Projects" in the Projects Type List, and choose "Windows Application " in the Templates List.
- Type the project name as "Printer Driver Client Installer" in the Project Name field, and then choose OK. If desired, type a new location for your project or select a directory using the Browse button, and then choose OK.
- In the "Solution Explorer" window, right-click on the "References" folder, and select "Add Reference..." from the context menu. In the "Add Reference" dialog box, select the ".NET" tab and browse to Leadtools For .NET "<LEADTOOLS_INSTALLDIR>\Bin\DotNet\Win32 " folder and select the following DLLs:
- Leadtools.Printer.Client.Installer.dll
- Switch to Form1 code view (right-click Form1 in the solution explorer then select View Code ) and add the following line:
[Visual Basic]
Imports Leadtools.Printer.Client.Installer
[C#]
using Leadtools.Printer.Client.Installer;
- To set a demo DLL for a specific printer, add an event handler to the Form1 Load event and add the following code:
[Visual Basic]
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
PrinterInstaller.SetPrinterConnectionDll("Printer Name","Path to Demo DLL", "Server name")
End Sub
[C#]
private void Form1_Load(object sender, System.EventArgs e)
{
PrinterInstaller.SetPrinterConnectionDll("Printer Name","Path to Demo DLL", "Server name");
}
- Build and run the application. You can use this application to install a printer to a Client.