PrintTicket.PageOrientation Eigenschaft

Definition

Ruft einen Wert ab, der angibt, mit welcher Ausrichtung der Seiteninhalt gedruckt wird, oder legt diesen fest.

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)

Eigenschaftswert

Nullable<PageOrientation>

Ein PageOrientation-Wert, der die Ausrichtung des Seiteninhalts angibt, wie z. B. Landscape oder ReversePortrait.

Ausnahmen

In einem aufrufenden Code wurde versucht, die Eigenschaft auf einen Wert festzulegen, der nicht in der PageOrientation-Enumeration vorhanden ist.

Beispiele

Im folgenden Beispiel wird gezeigt, wie Sie diese Eigenschaft verwenden, um einen Druckauftrag zu konfigurieren.

// 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

Hinweise

Ein null Wert für diese Eigenschaft bedeutet, dass diese Featureeinstellung nicht angegeben wird. Auch wenn der Wert nulllautet, enthält die XML-Versionen der PrintTicket (siehe SaveTo und GetXmlStream) kein Markup für dieses Feature.

Diese Eigenschaft entspricht dem Schlüsselwort "Print SchemaPageOrientation".

Sie können die Optionen testen, die der Drucker unterstützt, indem Sie die PageOrientationCapability Eigenschaft verwenden.

Gilt für