Ler em inglês

Compartilhar via


PageRangeSelection Enumeração

Definição

Especifica se todas as páginas ou apenas um intervalo limitado será processado por uma operação, geralmente impressão.

C#
public enum PageRangeSelection
Herança
PageRangeSelection

Campos

AllPages 0

Todas as páginas.

CurrentPage 2

A página atual.

SelectedPages 3

As páginas selecionadas.

UserPages 1

Um intervalo de páginas especificado pelo usuário.

Exemplos

O exemplo a seguir mostra como usar a enumeração para definir a PageRangeSelection propriedade usando XAML (Extensible Application Markup Language) e código.

XAML
<Button Width="200" Click="InvokePrint">Invoke PrintDialog</Button>

...

C#
private void InvokePrint(object sender, RoutedEventArgs e)
    {
        // Create the print dialog object and set options
        PrintDialog pDialog = new PrintDialog();
        pDialog.PageRangeSelection = PageRangeSelection.AllPages;
        pDialog.UserPageRangeEnabled = true;

        // Display the dialog. This returns true if the user presses the Print button.
        Nullable<Boolean> print = pDialog.ShowDialog();
        if (print == true)
        {
            XpsDocument xpsDocument = new XpsDocument("C:\\FixedDocumentSequence.xps", FileAccess.ReadWrite);
            FixedDocumentSequence fixedDocSeq = xpsDocument.GetFixedDocumentSequence();
            pDialog.PrintDocument(fixedDocSeq.DocumentPaginator, "Test print job");
        }
    }

Comentários

Essa enumeração é usada principalmente como o valor da PageRangeSelection propriedade do PrintDialog.

Aplica-se a

Produto Versões
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7