UnInstall Method

Summary
Uninstalls the printer from the system.
Syntax
C#
C++/CLI
public static void UnInstall( 
   PrinterInfo printerInfo 
) 
public: 
static void UnInstall(  
   PrinterInfo^ printerInfo 
)  

Parameters

printerInfo
Printer information that was used when installing the printer to the system.

Remarks

Fill the Leadtools.Printer.PrinterInfo.MonitorName, and Leadtools.Printer.PrinterInfo.PortName properties with valid data.

Notice that this method removes all printers that were using the driver name specified in the PrinterInfo.DriverName property.

To install a printer to the system, use the Install method.

Example
C#
using Leadtools.Printer; 
using Leadtools; 
 
 
public void InstallNewPrinter() 
{ 
   try 
   { 
 
      string printerName = "Test LEADTOOLS Printer3"; 
      string printerPassword = "Test Password"; 
      if (Printer.IsLeadtoolsPrinter(printerName)) 
      { 
         PrinterInfo tmpPrinterInfo = new PrinterInfo(); 
         tmpPrinterInfo.PrinterName = printerName; 
         Printer.UnInstall(tmpPrinterInfo); 
      } 
 
      string documentPrinterRegPath = "SOFTWARE\\LEAD Technologies, Inc.\\22\\Printer\\"; 
      PrinterInfo printerInfo = new PrinterInfo(); 
      printerInfo.MonitorName = printerName; 
      printerInfo.PortName = printerName; 
      printerInfo.ProductName = printerName; 
      printerInfo.PrinterName = printerName; 
      printerInfo.Password = printerPassword; 
      printerInfo.RegistryKey = documentPrinterRegPath + printerName; 
      printerInfo.RootDir = @"C:\LEADTOOLS22\Bin\Common\PrinterDriver"; 
      printerInfo.Url = "https://www.leadtools.com"; 
      printerInfo.PrinterExe = @"C:\LEADTOOLS22\Bin\DotNet4\Win32\"; 
      printerInfo.AboutString = "LEADTOOLS Printer"; 
      //printerInfo.AboutIcon = Path.Combine(LEAD_VARS.ImagesDir, @"\RasterPro.ico"); 
 
      Printer.Install(printerInfo); 
 
      string strMsg = string.Format("Installation {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:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

See Also

Reference

Printer Class

Printer Members

Help Version 22.0.2023.1.25
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Printer Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.