IXpsFixedPageReader Interface

Definição

Define métodos para ler as partes de um 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
Implementações

Exemplos

O exemplo seguinte mostra como obter uma IXpsFixedPageReader coleção a partir de um IXpsFixedDocumentReader. O exemplo também mostra como usar o leitor de páginas fixas para adicionar um novo StoryFragment que defina a estrutura do documento da 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()

Propriedades

Name Description
ColorContexts

Obtém uma coleção de todos os contextos de cor na página.

Fonts

Obtém uma coleção de todas as fontes usadas na página.

Images

Obtém uma coleção de todas as imagens da página.

PageNumber

Fica com o número da página.

PrintTicket

Obtém o PrintTicket, se existir um bilhete, que está associado ao FixedPage.

ResourceDictionaries

Obtém uma coleção de todos os dicionários de recursos da página.

StoryFragment

Recebe a StoryFragments parte da marcação de um pacote XPS.

Thumbnail

Obtém a imagem em miniatura, se existir uma miniatura, que está associada ao FixedPage.

Uri

Obtém o identificador uniforme de recurso (URI) do FixedPage.

XmlReader

Recebe um XmlReader para a página.

Métodos

Name Description
AddStoryFragment()

Adiciona um StoryFragments elemento a um pacote XPS.

(Herdado de IStoryFragmentProvider)
GetColorContext(Uri)

Obtém o contexto de cor para o recurso que tem o identificador uniforme de recurso (URI) especificado.

GetFont(Uri)

Obtém a fonte que tem o identificador uniforme de recurso (URI) especificado.

GetImage(Uri)

Obtém a imagem que tem o identificador uniforme de recurso (URI) especificado.

GetResource(Uri)

Obtém o recurso que tem o identificador uniforme de recurso (URI) especificado.

GetResourceDictionary(Uri)

Obtém o dicionário de recursos que tem o identificador uniforme de recurso (URI) especificado.

Aplica-se a