10.13. Retrieve Information About Installed Printers

Problem

You need to retrieve a list of available printers.

Solution

Read the names in the InstalledPrinters collection of the System.Drawing.Printing.PrinterSettings class.

How It Works

The PrinterSettings class encapsulates the settings for a printer and information about the printer. For example, you can use the PrinterSettings class to determine supported paper sizes, paper sources, and resolutions and check for the ability to print color or double-sided (duplexed) pages. In addition, you can retrieve default page settings for margins, page orientation, and so on.

The PrinterSettings class provides a Shared InstalledPrinters string collection, which includes the name of every printer installed ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.