PrintCapabilities.PageMediaSizeCapability Property
Gets a collection of PageMediaSize objects that identify the paper and media sizes that a printer supports.
Namespace: System.Printing
Assembly: ReachFramework (in ReachFramework.dll)
Property Value
Type: System.Collections.ObjectModel.ReadOnlyCollection<PageMediaSize>A ReadOnlyCollection<T> of PageMediaSize objects.
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 PageMediaSizeCapability, you must enumerate through each of its members, comparing them with the desired value.
If the printer does not support media size selection, the collection is empty.
This property corresponds to the Print Schema's PageMediaSize keyword.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.