Win32_PrinterConfiguration class

The Win32_PrinterConfiguration WMI class represents the configuration for a printer device. This includes capabilities such as resolution, color, fonts, and orientation.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties. Properties are listed in alphabetic order, not MOF order.

Syntax

class Win32_PrinterConfiguration : CIM_Setting
{
  string  Caption;
  string  Description;
  string  SettingID;
  uint32  BitsPerPel;
  boolean Collate;
  uint32  Color;
  uint32  Copies;
  string  DeviceName;
  uint32  DisplayFlags;
  uint32  DisplayFrequency;
  uint32  DitherType;
  uint32  DriverVersion;
  boolean Duplex;
  string  FormName;
  uint32  HorizontalResolution;
  uint32  ICMIntent;
  uint32  ICMMethod;
  uint32  LogPixels;
  uint32  MediaType;
  string  Name;
  uint32  Orientation;
  uint32  PaperLength;
  string  PaperSize;
  uint32  PaperWidth;
  uint32  PelsHeight;
  uint32  PelsWidth;
  uint32  PrintQuality;
  uint32  Scale;
  uint32  SpecificationVersion;
  uint32  TTOption;
  uint32  VerticalResolution;
  uint32  XResolution;
  uint32  YResolution;
};

Members

The Win32_PrinterConfiguration class has these types of members:

Properties

The Win32_PrinterConfiguration class has these properties.

BitsPerPel

Data type: uint32

Access type: Read-only

Qualifiers: Deprecated

Number of bits used to represent the color in this configuration (the bits per pixel). This property is obsolete. Instead, use properties in the Win32_VideoController, Win32_DesktopMonitor, or CIM_VideoControllerResolution classes to determine how color is represented.

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

Short textual description of the current object.

This property is inherited from CIM_Setting.

Collate

Data type: boolean

Access type: Read-only

If TRUE, the pages that are printed should be collated. To collate is to print out the entire document before printing the next copy, as opposed to printing out each page of the document the required number of times.

This property is ignored unless the printer driver indicates support for collation.

Color

Data type: uint32

Access type: Read-only

Color of the document. Some color printers have the capability to print using true black instead of a combination of cyan, magenta, and yellow (CMY). This usually creates darker and sharper text for documents. This option is only useful for color printers that support true black printing.

1

Monochrome (true black)

2

Color

Copies

Data type: uint32

Access type: Read-only

Number of copies to be printed. The printer driver must support printing multi-page copies.

Example: 2

Description

Data type: string

Access type: Read-only

Textual description of the current object.

This property is inherited from CIM_Setting.

DeviceName

Data type: string

Access type: Read-only

Friendly name of the printer. This name is unique to the type of printer and may be truncated because of the limitations of the string from which it is derived.

Example: "PCL/HP LaserJet"

DisplayFlags

Data type: uint32

Access type: Read-only

Indicates whether the display device is color or monochrome and whether the type of scanning is noninterlaced or interlaced. This property is obsolete. Instead, use display properties such as the DisplayType property of the Win32_DesktopMonitor class.

DisplayFrequency

Data type: uint32

Access type: Read-only

Displays the vertical refresh rate. The refresh rate for a monitor is the number of times the screen is redrawn per second (frequency). This property is obsolete. Instead, use properties in the Win32_VideoController, Win32_DesktopMonitor, or CIM_VideoControllerResolution class.

DitherType

Data type: uint32

Access type: Read-only

Dither type of the printer. This property can assume predefined values of 1 to 5, or driver-defined values from 6 to 256. Line art dithering is a special dithering method that produces well defined borders between black, white, and gray scalings. It is not suitable for images that include continuous graduations in intensity and hue, such as scanned photographs.

1

No Dithering

2

Coarse Brush

3

Fine Brush

4

Line Art

5

Grayscale

DriverVersion

Data type: uint32

Access type: Read-only

Version number of the Windows-based printer driver. The version numbers are created and maintained by the driver manufacturer.

Duplex

Data type: boolean

Access type: Read-only

If TRUE, printing is done on both sides. If FALSE, printing is done on only one side of the media.

FormName

Data type: string

Access type: Read-only

Not supported.

HorizontalResolution

Data type: uint32

Access type: Read-only

Qualifiers: Units (dots per inch)

Print resolution in dots per inch along the x-axis (width) of the print job (similar to the obsolete XResolution property). This value is only set when the PrintQuality property of this class is positive.

ICMIntent

Data type: uint32

Access type: Read-only

Specific value of one of the three possible color matching methods (called intents) that should be used by default. ICM applications establish intents by using the ICM functions. This property can assume predefined values of 1 to 3, or driver-defined values from 4 to 256. Non-ICM applications can use this value to determine how the printer handles color printing jobs.

1

Saturation

2

Contrast

3

Exact Color

ICMMethod

Data type: uint32

Access type: Read-only

How ICM is handled. For a non-ICM application, this property determines if ICM is enabled or disabled. For ICM applications, the system examines this property to determine which part of the computer system handles ICM support.

1

Disabled

2

Windows

3

Device Driver

4

Device

LogPixels

Data type: uint32

Access type: Read-only

Qualifiers: Deprecated

Number of pixels per logical inch. This obsolete property is valid only with devices that work with pixels, which excludes devices such as printers. There is no replacement value that applies to printers.

MediaType

Data type: uint32

Access type: Read-only

Type of media on which the printer prints. The property can be set to a predefined value or a driver-defined value greater than or equal to 256.

1

Standard

2

Transparency

3

Glossy

Name

Data type: string

Access type: Read-only

Qualifiers: Key, MaxLen (256)

Name of the printer with which this configuration is associated. This value matches the Name property of the associated Win32_Printer instance.

Orientation

Data type: uint32

Access type: Read-only

Printing orientation of the paper.

1

Portrait

2

Landscape

PaperLength

Data type: uint32

Access type: Read-only

Qualifiers: Units (Tenths of a millimeter)

Length of the paper. To determine the size of the paper in inches, divide this value by 254.

Example: 2794

PaperSize

Data type: string

Access type: Read-only

Size of the paper. The possible sizes are found in the PaperSizesSupported property of the associated Win32_Printer class.

Example: "A4 or Letter".

PaperWidth

Data type: uint32

Access type: Read-only

Qualifiers: Units (Tenths of a millimeter)

Width of the paper. To determine the size of the paper in inches, divide this value by 254.

Example: 2159

PelsHeight

Data type: uint32

Access type: Read-only

Qualifiers: Deprecated

This property is not supported.

PelsWidth

Data type: uint32

Access type: Read-only

Qualifiers: Deprecated

This property is not supported.

PrintQuality

Data type: uint32

Access type: Read-only

One of four quality levels of the print job. If a positive value is specified, the quality is measured in dots per inch.

-1

Draft

-2

Low

-3

Medium

-4

High

Scale

Data type: uint32

Access type: Read-only

Qualifiers: Units (Percent)

Factor by which the printed output is to be scaled. For example, a scale of 75 reduces the print output to 3/4 its original height and width.

SettingID

Data type: string

Access type: Read-only

Qualifiers: MaxLen (256)

Identifier by which the current object is known.

This property is inherited from CIM_Setting.

SpecificationVersion

Data type: uint32

Access type: Read-only

Version number of the initialization data for the device associated with the Windows-based printer.

TTOption

Data type: uint32

Access type: Read-only

Indicates how TrueType fonts should be printed.

Bitmap (1)

Prints TrueType fonts as graphics. This is the default action for dot-matrix printers.

Download (2)

Downloads TrueType fonts as soft fonts. This is the default action for printers that use the Printer Control Language (PCL).

Substitute (3)

Substitutes device fonts for TrueType fonts. This is the default action for PostScript printers.

VerticalResolution

Data type: uint32

Access type: Read-only

Qualifiers: Units (dots per inch)

Print resolution along the y-axis (height) of the print job (similar to the obsolete YResolution property). This value is only set when the PrintQuality property of this class is positive.

XResolution

Data type: uint32

Access type: Read-only

Qualifiers: Deprecated

This property is obsolete. Use the HorizontalResolution property instead.

YResolution

Data type: uint32

Access type: Read-only

Qualifiers: Deprecated

This property is obsolete. Use the VerticalResolution property instead.

Remarks

The Win32_PrinterConfiguration class is derived from CIM_Setting.

Overview

Before you can determine how to best distribute and use your printing resources, you must have a detailed knowledge of those resources. For example, Department A might have only three printers compared with five printers in Department B. However, if the printers in Department A can print 20 pages per minute and the printers in Department B can print only 5 pages per minute, users in Department A actually have more printing capacity. Without knowing the detailed capabilities of these printers, you might erroneously conclude that Department A is short on printing capacity and thus purchase additional printers that end up going unused.

WMI includes two classes, Win32_Printer and Win32_PrinterConfiguration, which can be used to return detailed information about all the printers installed on a computer.

Examples

The following code sample retrieves printer information.

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_PrinterConfiguration")
For Each objPrinter in colInstalledPrinters
 Wscript.Echo "Name: " & objPrinter.Name
 Wscript.Echo "Collate: " & objPrinter.Collate
 Wscript.Echo "Copies: " & objPrinter.Copies
 Wscript.Echo "Driver Version: " & objPrinter.DriverVersion
 Wscript.Echo "Duplex: " & objPrinter.Duplex
 Wscript.Echo "Horizontal Resolution: " & _
 objPrinter.HorizontalResolution
 If objPrinter.Orientation = 1 Then
 strOrientation = "Portrait"
 Else
 strOrientation = "Landscape"
 End If
 Wscript.Echo "Orientation : " & strOrientation
 Wscript.Echo "Paper Length: " & objPrinter.PaperLength / 254
 Wscript.Echo "Paper Width: " & objPrinter.PaperWidth / 254
 Wscript.Echo "Print Quality: " & objPrinter.PrintQuality
 Wscript.Echo "Scale: " & objPrinter.Scale
 Wscript.Echo "Specification Version: " & _
 objPrinter.SpecificationVersion
 If objPrinter.TTOption = 1 Then
 strTTOption = "Print TrueType fonts as graphics."
 ElseIf objPrinter.TTOption = 2 Then
 strTTOption = "Download TrueType fonts as soft fonts."
 Else
 strTTOption = "Substitute device fonts for TrueType fonts."
 End If
 Wscript.Echo "True Type Option: " & strTTOption
 Wscript.Echo "Vertical Resolution: " & objPrinter.VerticalResolution
Next

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
Win32_Printer.mof
DLL
CIMWin32.dll

See also

CIM_Setting

Computer System Hardware Classes