PrintCapabilities.PageResolutionCapability Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a collection of PageResolution objects that identify what levels of page resolution the printer supports.

Namespace:   System.Printing
Assembly:  ReachFramework (in ReachFramework.dll)

public ReadOnlyCollection<PageResolution> PageResolutionCapability { get; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<PageResolution>

A ReadOnlyCollection<T> of PageResolution objects. Each value represents a page resolution as a qualitative value, a dots-per-inch value, or both.

Most of the properties of PrintCapabilities that have "Capability" at the end of the name, such as CollationCapability, are collections of values of an enumerated type. But PageMediaSizeCapability and PageResolutionCapability are collections of objects. For the latter two properties, you cannot test for the presence of a particular value by using the Contains method of ReadOnlyCollection<T>. This is because, with reference types, the method returns true only when the memory address of the object passed to it is the same as the address of an object in the collection; that is, they are the same object. Since this will not usually be the case, the method will nearly always return false even if there is an object in the collection with exactly the same values in all its properties as the object passed to the Contains method of ReadOnlyCollection<T>. To determine the contents of the PageResolutionCapability, you must enumerate through each of its members, comparing them with the desired value. See the example.

The PageResolution class has properties in which you can specify the dots-per-inch for the X and Y dimensions and a property where you can give a qualitative expression to the resolution.

If the printer does not support page resolution choices, the collection is empty.

This property corresponds to the Print Schema's PageResolution keyword.

The following code example shows how to search for a particular value in the PageResolutionCapability.

foreach (PageResolution pageRes in pc.PageResolutionCapability)
    {
        if (pageRes.QualitativeResolution == PageQualitativeResolution.High)
        {
            Console.WriteLine("High quality is supported");
            break;
        }
    }

.NET Framework
Available since 3.0
Return to top
Show: