LEADTOOLS Virtual Printer (Leadtools.Printer assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
Install Method
See Also 
Leadtools.Printer Namespace > Printer Class : Install Method



printerInfo
Information to be used when installing the printer.

The Install Method is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.

printerInfo
Information to be used when installing the printer.
Installs the LEADTOOLS Virtual Printer to the system.

Syntax

Visual Basic (Declaration) 
Public Shared Sub Install( _
   ByVal printerInfo As PrinterInfo _
) 
Visual Basic (Usage)Copy Code
Dim printerInfo As PrinterInfo
 
Printer.Install(printerInfo)
C# 
public static void Install( 
   PrinterInfo printerInfo
)
C++/CLI 
public:
static void Install( 
   PrinterInfo^ printerInfo
) 

Parameters

printerInfo
Information to be used when installing the printer.

Example

Visual BasicCopy Code
Public Sub InstallNewPrinter()
   Try
      Dim printerName As String = "Test LEADTOOLS Printer"
      Dim printerPassword As String = "Test Password"
      If (Printer.IsLeadtoolsPrinter(printerName)) Then
         Dim tmpPrinterInfo As New PrinterInfo()
         tmpPrinterInfo.PrinterName = printerName
         tmpPrinterInfo.DriverName = printerName
         Printer.UnInstall(tmpPrinterInfo)
      End If

      Dim documentPrinterRegPath As String = "SOFTWARE\\LEAD Technologies, Inc.\\17\\Printer\\"
      Dim printerInfo As New PrinterInfo()
      printerInfo.DriverName = printerName
      printerInfo.ProductName = printerName
      printerInfo.PrinterName = printerName
      printerInfo.Password = printerPassword
      printerInfo.RegistryKey = documentPrinterRegPath + printerName
      printerInfo.RootDir = "C:\\Program Files\\LEAD Technologies\\LEADTOOLS 17\\Bin\\Common\\PrinterDriver"
      printerInfo.Url = "http://www.LeadtoolsPrinterDriver.com"
      printerInfo.PrinterExe = Application.ExecutablePath
      printerInfo.AboutString = "LEADTOOLS Printer"
      printerInfo.AboutIcon = Path.Combine(LEAD_VARS.ImagesDir, "\\RasterPro.ico")

      Printer.Install(printerInfo)

      Dim strMsg As String = String.Format("Installion {0} Completed Successfully", printerName)
      MessageBox.Show(strMsg, "LEADTOOLS Printer Demo", MessageBoxButtons.OK, MessageBoxIcon.Information)
   Catch ex As PrinterDriverException
      MessageBox.Show(String.Format("Other error: Message:{0}", ex.Message))
   End Try
End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
C#Copy Code
public  void InstallNewPrinter()
   {
      try
      {
         string printerName = "Test LEADTOOLS Printer";
         string printerPassword = "Test Password";
         if (Printer.IsLeadtoolsPrinter(printerName))
         {
            PrinterInfo tmpPrinterInfo = new PrinterInfo();
            tmpPrinterInfo.PrinterName = printerName;
            tmpPrinterInfo.DriverName = printerName;
            Printer.UnInstall(tmpPrinterInfo);
         }

         string documentPrinterRegPath = "SOFTWARE\\LEAD Technologies, Inc.\\17\\Printer\\";
         PrinterInfo printerInfo = new PrinterInfo();
         printerInfo.DriverName = printerName;
         printerInfo.ProductName = printerName;
         printerInfo.PrinterName = printerName;
         printerInfo.Password = printerPassword;
         printerInfo.RegistryKey = documentPrinterRegPath + printerName;
         printerInfo.RootDir = @"C:\Program Files\LEAD Technologies\LEADTOOLS 17\Bin\Common\PrinterDriver";
         printerInfo.Url = "http://www.Leadtools.com";
         printerInfo.PrinterExe = Application.ExecutablePath;
         printerInfo.AboutString = "LEADTOOLS Printer";
         printerInfo.AboutIcon = Path.Combine(LEAD_VARS.ImagesDir, @"\RasterPro.ico");

         Printer.Install(printerInfo);

         string strMsg = string.Format("Installion {0} Completed Successfully", printerName);
         MessageBox.Show(strMsg, "LEADTOOLS Printer Demo", MessageBoxButtons.OK, MessageBoxIcon.Information);
      }
      catch (PrinterDriverException ex)
      {
         MessageBox.Show(string.Format("Other error: Message:{0}", ex.Message));
      }
   }

static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}

Remarks

To uninstall a printer from the system, use the UnInstall method.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Printer requires a Printer module license and unlock key. It is included as part of LEADTOOLS Document Imaging Enterprise. For more information, refer to: Imaging Pro/Document/Medical Features