Getting all installed printers in system using C# .NET

If a printer is installed on the machine, the following code will list the installed printer(s) in the system. Add a listbox named printersList to a windows form and use the following in the form_load.

using System.Drawing.Printing;
private void Form1_Load(object sender, EventArgs e)
{
    foreach (String printer in PrinterSettings.InstalledPrinters)
    {
        printersList.Items.Add(printer.ToString());
    }
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.