PageMediaType PageMediaType PageMediaType PageMediaType Enum

Definition

Specifies types of printing paper or other media.

public enum class PageMediaType
public enum PageMediaType
type PageMediaType = 
Public Enum PageMediaType
Inheritance
PageMediaTypePageMediaTypePageMediaTypePageMediaType

Fields

Archival Archival Archival Archival 2

Archive-quality media.

AutoSelect AutoSelect AutoSelect AutoSelect 1

The print device selects the media.

BackPrintFilm BackPrintFilm BackPrintFilm BackPrintFilm 3

Specialty back-printing film.

Bond Bond Bond Bond 4

Standard bond media.

CardStock CardStock CardStock CardStock 5

Standard card stock.

Continuous Continuous Continuous Continuous 6

Continuous-feed media.

EnvelopePlain EnvelopePlain EnvelopePlain EnvelopePlain 7

Standard envelope.

EnvelopeWindow EnvelopeWindow EnvelopeWindow EnvelopeWindow 8

Window envelope.

Fabric Fabric Fabric Fabric 9

Fabric media.

HighResolution HighResolution HighResolution HighResolution 10

Specialty high-resolution media.

Label Label Label Label 11

Label media.

MultiLayerForm MultiLayerForm MultiLayerForm MultiLayerForm 12

Attached multipart forms.

MultiPartForm MultiPartForm MultiPartForm MultiPartForm 13

Individual multipart forms.

None None None None 29

Unknown or unlisted media.

Photographic Photographic Photographic Photographic 14

Standard photographic media.

PhotographicFilm PhotographicFilm PhotographicFilm PhotographicFilm 15

Film photographic media.

PhotographicGlossy PhotographicGlossy PhotographicGlossy PhotographicGlossy 16

Glossy photographic media.

PhotographicHighGloss PhotographicHighGloss PhotographicHighGloss PhotographicHighGloss 17

High-gloss photographic media.

PhotographicMatte PhotographicMatte PhotographicMatte PhotographicMatte 18

Matte photographic media.

PhotographicSatin PhotographicSatin PhotographicSatin PhotographicSatin 19

Satin photographic media.

PhotographicSemiGloss PhotographicSemiGloss PhotographicSemiGloss PhotographicSemiGloss 20

Semi-gloss photographic media.

Plain Plain Plain Plain 21

Plain paper.

Screen Screen Screen Screen 22

Output to a display in continuous form.

ScreenPaged ScreenPaged ScreenPaged ScreenPaged 23

Output to a display in paged form.

Stationery Stationery Stationery Stationery 24

Specialty stationary.

TabStockFull TabStockFull TabStockFull TabStockFull 25

Tab stock, not precut (single tabs).

TabStockPreCut TabStockPreCut TabStockPreCut TabStockPreCut 26

Tab stock, precut (multiple tabs).

Transparency Transparency Transparency Transparency 27

Transparent sheet.

TShirtTransfer TShirtTransfer TShirtTransfer TShirtTransfer 28

Media that is used to transfer an image to a T-shirt.

Unknown Unknown Unknown Unknown 0

The feature (whose options are represented by this enumeration) is set to an option not defined in the Print Schema.

Examples

The following example shows how to determine the printer capabilities and configure the print job to take advantage of them.

// ---------------------- GetPrintTicketFromPrinter -----------------------
/// <summary>
///   Returns a PrintTicket based on the current default printer.</summary>
/// <returns>
///   A PrintTicket for the current local default printer.</returns>
PrintTicket^ GetPrintTicketFromPrinter () 
{
   PrintQueue^ printQueue = nullptr;

   LocalPrintServer^ localPrintServer = gcnew LocalPrintServer();

   // Retrieving collection of local printer on user machine
   PrintQueueCollection^ localPrinterCollection = localPrintServer->GetPrintQueues();

   System::Collections::IEnumerator^ localPrinterEnumerator = localPrinterCollection->GetEnumerator();

   if (localPrinterEnumerator->MoveNext())
   {
      // Get PrintQueue from first available printer
      printQueue = ((PrintQueue^)localPrinterEnumerator->Current);
   } else
   {
      return nullptr;
   }
   // Get default PrintTicket from printer
   PrintTicket^ printTicket = printQueue->DefaultPrintTicket;

   PrintCapabilities^ printCapabilites = printQueue->GetPrintCapabilities();

   // Modify PrintTicket
   if (printCapabilites->CollationCapability->Contains(Collation::Collated))
   {
      printTicket->Collation = Collation::Collated;
   }
   if (printCapabilites->DuplexingCapability->Contains(Duplexing::TwoSidedLongEdge))
   {
      printTicket->Duplexing = Duplexing::TwoSidedLongEdge;
   }
   if (printCapabilites->StaplingCapability->Contains(Stapling::StapleDualLeft))
   {
      printTicket->Stapling = Stapling::StapleDualLeft;
   }
   return printTicket;
};// end:GetPrintTicketFromPrinter()
// ---------------------- GetPrintTicketFromPrinter -----------------------
/// <summary>
///   Returns a PrintTicket based on the current default printer.</summary>
/// <returns>
///   A PrintTicket for the current local default printer.</returns>
private PrintTicket GetPrintTicketFromPrinter()
{
    PrintQueue printQueue = null;

    LocalPrintServer localPrintServer = new LocalPrintServer();

    // Retrieving collection of local printer on user machine
    PrintQueueCollection localPrinterCollection =
        localPrintServer.GetPrintQueues();

    System.Collections.IEnumerator localPrinterEnumerator =
        localPrinterCollection.GetEnumerator();

    if (localPrinterEnumerator.MoveNext())
    {
        // Get PrintQueue from first available printer
        printQueue = (PrintQueue)localPrinterEnumerator.Current;
    }
    else
    {
        // No printer exist, return null PrintTicket
        return null;
    }

    // Get default PrintTicket from printer
    PrintTicket printTicket = printQueue.DefaultPrintTicket;

    PrintCapabilities printCapabilites = printQueue.GetPrintCapabilities();

    // Modify PrintTicket
    if (printCapabilites.CollationCapability.Contains(Collation.Collated))
    {
        printTicket.Collation = Collation.Collated;
    }

    if ( printCapabilites.DuplexingCapability.Contains(
            Duplexing.TwoSidedLongEdge) )
    {
        printTicket.Duplexing = Duplexing.TwoSidedLongEdge;
    }

    if (printCapabilites.StaplingCapability.Contains(Stapling.StapleDualLeft))
    {
        printTicket.Stapling = Stapling.StapleDualLeft;
    }

    return printTicket;
}// end:GetPrintTicketFromPrinter()
' ---------------------- GetPrintTicketFromPrinter -----------------------
''' <summary>
'''   Returns a PrintTicket based on the current default printer.</summary>
''' <returns>
'''   A PrintTicket for the current local default printer.</returns>
Private Function GetPrintTicketFromPrinter() As PrintTicket
    Dim printQueue As PrintQueue = Nothing

    Dim localPrintServer As New LocalPrintServer()

    ' Retrieving collection of local printer on user machine
    Dim localPrinterCollection As PrintQueueCollection = localPrintServer.GetPrintQueues()

    Dim localPrinterEnumerator As System.Collections.IEnumerator = localPrinterCollection.GetEnumerator()

    If localPrinterEnumerator.MoveNext() Then
        ' Get PrintQueue from first available printer
        printQueue = CType(localPrinterEnumerator.Current, PrintQueue)
    Else
        ' No printer exist, return null PrintTicket
        Return Nothing
    End If

    ' Get default PrintTicket from printer
    Dim printTicket As PrintTicket = printQueue.DefaultPrintTicket

    Dim printCapabilites As PrintCapabilities = printQueue.GetPrintCapabilities()

    ' Modify PrintTicket
    If printCapabilites.CollationCapability.Contains(Collation.Collated) Then
        printTicket.Collation = Collation.Collated
    End If

    If printCapabilites.DuplexingCapability.Contains(Duplexing.TwoSidedLongEdge) Then
        printTicket.Duplexing = Duplexing.TwoSidedLongEdge
    End If

    If printCapabilites.StaplingCapability.Contains(Stapling.StapleDualLeft) Then
        printTicket.Stapling = Stapling.StapleDualLeft
    End If

    Return printTicket
End Function ' end:GetPrintTicketFromPrinter()

Remarks

The values of this type are used primarily for these purposes:

The Unknownvalue is never used in properties of PrintCapabilities objects.

You should never set a PrintTicket property to Unknown. If some other PrintTicket producing application has created a PrintTicket document that sets the page media type feature to an unrecognized option (that is, an option that is not defined in the Print Schema), then a PrintTicket object in your application that is constructed with that document will have Unknown as the value of the PageMediaType property.

Although the PrintTicket and PrintCapabilities classes cannot be inherited, you can extend the Print Schema to recognize print device features that are not accounted for in the PageMediaType or PrintCapabilities classes. For more information, see How to: Extend the Print Schema and Create New Print System Classes.

Applies to

See also