PrintTicket.PageOrientation Eigenschap

Definitie

Hiermee wordt een waarde opgehaald of ingesteld die aangeeft hoe de pagina-inhoud is gericht op afdrukken.

public:
 property Nullable<System::Printing::PageOrientation> PageOrientation { Nullable<System::Printing::PageOrientation> get(); void set(Nullable<System::Printing::PageOrientation> value); };
public System.Printing.PageOrientation? PageOrientation { get; set; }
member this.PageOrientation : Nullable<System.Printing.PageOrientation> with get, set
Public Property PageOrientation As Nullable(Of PageOrientation)

Waarde van eigenschap

Een PageOrientation waarde die aangeeft hoe pagina-inhoud is gericht, bijvoorbeeldLandscape.ReversePortrait

Uitzonderingen

Het aanroepen van code heeft geprobeerd de eigenschap in te stellen op een waarde die zich niet in de PageOrientation opsomming bevindt.

Voorbeelden

In het volgende voorbeeld ziet u hoe u deze eigenschap gebruikt om een afdruktaak te configureren.

// Use different PrintTickets for different FixedDocuments.
PrintTicket ptFD = new PrintTicket();

if (_firstDocumentPrintTicket <= 1)
{   // Print the first document in black/white and in portrait
    // orientation.  Since the PrintTicket at the
    // FixedDocumentSequence level already specifies portrait
    // orientation, this FixedDocument can just inherit that
    // setting without having to set it again.
    ptFD.PageOrientation = PageOrientation.Portrait;
    ptFD.OutputColor = OutputColor.Monochrome;
    _firstDocumentPrintTicket++;
}

else // if (_firstDocumentPrintTicket > 1)
{   // Print the second document in color and in landscape
    // orientation.  Since the PrintTicket at the
    // FixedDocumentSequence level already specifies portrait
    // orientation, this FixedDocument needs to set its
    // PrintTicket with landscape orientation in order to
    // override the higher level setting.
    ptFD.PageOrientation = PageOrientation.Landscape;
    ptFD.OutputColor = OutputColor.Color;
}
' Use different PrintTickets for different FixedDocuments.
Dim ptFD As New PrintTicket()

If _firstDocumentPrintTicket <= 1 Then
    ' orientation.  Since the PrintTicket at the
    ' FixedDocumentSequence level already specifies portrait
    ' orientation, this FixedDocument can just inherit that
    ' setting without having to set it again.
    ptFD.PageOrientation = PageOrientation.Portrait
    ptFD.OutputColor = OutputColor.Monochrome
    _firstDocumentPrintTicket += 1

Else ' if (_firstDocumentPrintTicket > 1)
    ' orientation.  Since the PrintTicket at the
    ' FixedDocumentSequence level already specifies portrait
    ' orientation, this FixedDocument needs to set its
    ' PrintTicket with landscape orientation in order to
    ' override the higher level setting.
    ptFD.PageOrientation = PageOrientation.Landscape
    ptFD.OutputColor = OutputColor.Color
End If

Opmerkingen

Een null waarde voor deze eigenschap betekent dat deze functie-instelling niet is opgegeven. Wanneer de waarde is null, bevatten de XML-versies van de PrintTicket (zie SaveTo en GetXmlStream) geen markeringen voor deze functie.

Deze eigenschap komt overeen met het trefwoord van het afdrukschemaPageOrientation.

U kunt testen op de opties die de printer ondersteunt met behulp van de PageOrientationCapability eigenschap.

Van toepassing op