IXpsFixedPageReader Interface

Definition

Defines methods for reading the parts of a FixedPage.

C#
public interface IXpsFixedPageReader : System.Windows.Xps.Packaging.IStoryFragmentProvider
Implements

Examples

The following example shows how to obtain an IXpsFixedPageReader collection from an IXpsFixedDocumentReader. The sample also shows how to use the fixed-page reader to add a new StoryFragment that defines the document structure of the page.

C#
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();

Properties

ColorContexts

Gets a collection of all the color contexts on the page.

Fonts

Gets a collection of all the fonts that are used on the page.

Images

Gets a collection of all the images on the page.

PageNumber

Gets the page number.

PrintTicket

Gets the PrintTicket, if a ticket exists, that is associated with the FixedPage.

ResourceDictionaries

Gets a collection of all the resource dictionaries for the page.

StoryFragment

Gets the StoryFragments part of the markup of an XPS package.

Thumbnail

Gets the thumbnail image, if a thumbnail exists, that is associated with the FixedPage.

Uri

Gets the uniform resource identifier (URI) of the FixedPage.

XmlReader

Gets an XmlReader for the page.

Methods

AddStoryFragment()

Adds a StoryFragments element to an XPS package.

(Inherited from IStoryFragmentProvider)
GetColorContext(Uri)

Gets the color context for the resource that has the specified uniform resource identifier (URI).

GetFont(Uri)

Gets the font that has the specified uniform resource identifier (URI).

GetImage(Uri)

Gets the image that has the specified uniform resource identifier (URI).

GetResource(Uri)

Gets the resource that has the specified uniform resource identifier (URI).

GetResourceDictionary(Uri)

Gets the resource dictionary that has the specified uniform resource identifier (URI).

Applies to

Product Versions
.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, 10