Get All Installed Printers in C#

This class locates in System.Drawing.Printing namespace 

so you need to add reference System.Drawing and then import it with using statement:


using System.Drawing.Printing;

To get all the printers available,you need to iterate the string values through PrinterSettings

 

For example:

Add a ListBox to your windows application and then use foreach statement for iteration:


foreach (string printname in PrinterSettings.InstalledPrinters)
{
listBox1.Items.Add(printname);
}



This will show you all the available Printers installed on your computer as seen below:

art2.png

Because i've not installed any physical printers on my computer it shows the printer services.

Up Next
    Ebook Download
    View all
    Learn
    View all
    Araf Global is a software consultancy company founded in 2016 focusing on cutting edge technologies.