PrintTicket.PageOrientation Propriedade

Definição

Obtém ou define um valor que indica como o conteúdo da página é orientado para impressão.

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)

Valor da propriedade

Nullable<PageOrientation>

Um valor PageOrientation que especifica como o conteúdo da página é orientado, por exemplo, Landscape ou ReversePortrait.

Exceções

O código de chamada tentou definir a propriedade com um valor que não está na enumeração PageOrientation.

Exemplos

O exemplo a seguir mostra como usar essa propriedade para configurar um trabalho de impressão.

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

Comentários

Um null valor para essa propriedade significa que essa configuração de recurso não é especificada. Além disso, quando o valor for null, as versões XML do PrintTicket (ver SaveTo e GetXmlStream) não conterão nenhuma marcação para esse recurso.

Essa propriedade corresponde à palavra-chave do Esquema de PageOrientation Impressão.

Você pode testar as opções compatíveis com a impressora usando a PageOrientationCapability propriedade.

Aplica-se a