Leer en inglés

Compartir a través de


PageRangeSelection Enumeración

Definición

Especifica si una operación procesará todas las páginas o sólo un intervalo limitado, normalmente mediante impresión.

C#
public enum PageRangeSelection
Herencia
PageRangeSelection

Campos

Nombre Valor Description
AllPages 0

Todas las páginas.

CurrentPage 2

Página actual.

SelectedPages 3

Páginas seleccionadas.

UserPages 1

Intervalo de páginas especificado por el usuario.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la enumeración para establecer la PageRangeSelection propiedad mediante lenguaje de marcado de aplicación extensible (XAML) y 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");
        }
    }

Comentarios

Esta enumeración se usa principalmente como valor de la PageRangeSelection propiedad de PrintDialog.

Se aplica a

Producto Versiones
.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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9