PrintTicket.PageOrientation 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指出頁面內容的列印方向。
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)
屬性值
PageOrientation 值,指出頁面內容的列印方向,例如 Landscape 或 ReversePortrait。
例外狀況
呼叫程式碼嘗試將屬性設定為不屬於 PageOrientation 列舉的值。
範例
下列範例示範如何使用這個屬性來設定列印作業。
// 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
備註
null
此屬性的值表示未指定這項功能設定。 此外,當值為 null
時, () 的 XML 版本 PrintTicket 將不會 SaveToGetXmlStream 包含此功能的任何標記。
此屬性會對應至 列印架構的 PageOrientation
關鍵詞。
您可以使用 屬性來測試印表機支援 PageOrientationCapability 的選項。