IXpsFixedPageReader Interfaz

Definición

Define métodos para leer las partes de .FixedPage

public interface class IXpsFixedPageReader : System::Windows::Xps::Packaging::IStoryFragmentProvider
public interface IXpsFixedPageReader : System.Windows.Xps.Packaging.IStoryFragmentProvider
type IXpsFixedPageReader = interface
    interface IStoryFragmentProvider
Public Interface IXpsFixedPageReader
Implements IStoryFragmentProvider
Implementaciones

Ejemplos

En el ejemplo siguiente se muestra cómo obtener una IXpsFixedPageReader colección de .IXpsFixedDocumentReader En el ejemplo también se muestra cómo usar el lector de página fija para agregar un nuevo StoryFragment que defina la estructura del documento de la página.

ShowStatus("   Getting FixedDocumentSequenceReader.");
IXpsFixedDocumentSequenceReader fixedDocSeqReader =
    xpsDocument.FixedDocumentSequenceReader;

ShowStatus("   Getting FixedDocumentReaders.");
ICollection<IXpsFixedDocumentReader> fixedDocuments =
    fixedDocSeqReader.FixedDocuments;

ShowStatus("   Getting FixedPageReaders.");
IEnumerator<IXpsFixedDocumentReader> enumerator =
    fixedDocuments.GetEnumerator();
enumerator.MoveNext();
ICollection<IXpsFixedPageReader> fixedPages =
    enumerator.Current.FixedPages;

// Add a document structure to each fixed page.
int i = 0;
foreach (IXpsFixedPageReader fixedPageReader in fixedPages)
{
    XpsResource pageStructure;
    ShowStatus("   Adding page structure resource:\n       '" +
                       Filename(_fixedPageStructures[i]) + "'");
    try
    {   // Add a new StoryFragment to hold the page structure.
        pageStructure = fixedPageReader.AddStoryFragment();
    }
    catch (System.InvalidOperationException)
    {
        MessageBox.Show(xpsUnstructuredFile +
            "\n\nDocument structure cannot be added.\n\n" +
            Filename(xpsUnstructuredFile) + " might already " +
            "contain an existing document structure.",
            "Cannot Add Document Structure",
            MessageBoxButton.OK, MessageBoxImage.Error);
        break;
    }

    // Copy the page structure to the new StoryFragment.
    WriteResource(pageStructure, _fixedPageStructures[i++]);
}

ShowStatus("   Saving and closing the new document.\n");
xpsDocument.Close();
ShowStatus("   Getting FixedDocumentSequenceReader.")
Dim fixedDocSeqReader As IXpsFixedDocumentSequenceReader = xpsDocument.FixedDocumentSequenceReader

ShowStatus("   Getting FixedDocumentReaders.")
Dim fixedDocuments As ICollection(Of IXpsFixedDocumentReader) = fixedDocSeqReader.FixedDocuments

ShowStatus("   Getting FixedPageReaders.")
Dim enumerator As IEnumerator(Of IXpsFixedDocumentReader) = fixedDocuments.GetEnumerator()
enumerator.MoveNext()
Dim fixedPages As ICollection(Of IXpsFixedPageReader) = enumerator.Current.FixedPages


' Add a document structure to each fixed page.
Dim i As Integer = 0
For Each fixedPageReader As IXpsFixedPageReader In fixedPages
    Dim pageStructure As XpsResource
    ShowStatus("   Adding page structure resource:" & vbLf & "       '" & Filename(_fixedPageStructures(i)) & "'")
    Try
        pageStructure = fixedPageReader.AddStoryFragment()
    Catch e2 As InvalidOperationException
        System.Windows.MessageBox.Show(xpsUnstructuredFile & vbLf & vbLf & "Document structure cannot be added." & vbLf & vbLf & Filename(xpsUnstructuredFile) & " might already " & "contain an existing document structure.",
                        "Cannot Add Document Structure",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error)
        Exit For
    End Try

    ' Copy the page structure to the new StoryFragment.
    WriteResource(pageStructure, _fixedPageStructures(i))
    i += 1
Next fixedPageReader

ShowStatus("   Saving and closing the new document." & vbLf)
xpsDocument.Close()

Propiedades

Nombre Description
ColorContexts

Obtiene una colección de todos los contextos de color de la página.

Fonts

Obtiene una colección de todas las fuentes que se usan en la página.

Images

Obtiene una colección de todas las imágenes de la página.

PageNumber

Obtiene el número de página.

PrintTicket

Obtiene , PrintTicketsi existe un vale, que está asociado a .FixedPage

ResourceDictionaries

Obtiene una colección de todos los diccionarios de recursos de la página.

StoryFragment

Obtiene la StoryFragments parte del marcado de un paquete XPS.

Thumbnail

Obtiene la imagen en miniatura, si existe una miniatura, que está asociada a .FixedPage

Uri

Obtiene el identificador uniforme de recursos (URI) de FixedPage.

XmlReader

Obtiene un XmlReader para la página.

Métodos

Nombre Description
AddStoryFragment()

Agrega un StoryFragments elemento a un paquete XPS.

(Heredado de IStoryFragmentProvider)
GetColorContext(Uri)

Obtiene el contexto de color del recurso que tiene el identificador uniforme de recursos (URI) especificado.

GetFont(Uri)

Obtiene la fuente que tiene el identificador uniforme de recursos (URI) especificado.

GetImage(Uri)

Obtiene la imagen que tiene el identificador uniforme de recursos (URI) especificado.

GetResource(Uri)

Obtiene el recurso que tiene el identificador uniforme de recursos (URI) especificado.

GetResourceDictionary(Uri)

Obtiene el diccionario de recursos que tiene el identificador uniforme de recursos (URI) especificado.

Se aplica a