Export (0) Print
Expand All

IXpsFixedPageWriter Interface

Defines methods for writing FixedPage parts to an XPS document.

Namespace:  System.Windows.Xps.Packaging
Assembly:  ReachFramework (in ReachFramework.dll)

public interface IXpsFixedPageWriter : IStoryFragmentProvider
Interfaces cannot be used directly in XAML; see types that implement this interface.

The following example shows how to use the AddFixedPage method to obtain a fixed-page writer for adding pages to an XpsDocument.

// ------------------------- AddDocumentContent --------------------------- 
/// <summary> 
///   Adds a predefined set of content to a given document writer.</summary> 
/// <param name="fixedDocumentWriter">
///   The document writer to add the content to.</param> 
private void AddDocumentContent(IXpsFixedDocumentWriter fixedDocumentWriter)
{
    // Collection of image and font resources used on the current page. 
    //   Key: "XpsImage", "XpsFont" 
    //   Value: List of XpsImage or XpsFont resources
    Dictionary<string, List<XpsResource>> resources;

    try
    {
        // Add Page 1 to current document.
        IXpsFixedPageWriter fixedPageWriter =
            fixedDocumentWriter.AddFixedPage();

        // Add the resources for Page 1 and get the resource collection.
        resources = AddPageResources(fixedPageWriter);

        // Write page content for Page 1.
        WritePageContent(fixedPageWriter.XmlWriter,
            "Page 1 of " + fixedDocumentWriter.Uri.ToString(), resources);

        // Commit Page 1.
        fixedPageWriter.Commit();

        // Add Page 2 to current document.
        fixedPageWriter = fixedDocumentWriter.AddFixedPage();

        // Add the resources for Page 2 and get the resource collection.
        resources = AddPageResources(fixedPageWriter);

        // Write page content to Page 2.
        WritePageContent(fixedPageWriter.XmlWriter,
            "Page 2 of " + fixedDocumentWriter.Uri.ToString(), resources);

        // Commit Page 2.
        fixedPageWriter.Commit();
    }
    catch (XpsPackagingException xpsException)
    {
        throw xpsException;
    }
}// end:AddDocumentContent()

For the complete sample, see Creating an XPS Document Sample.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2015 Microsoft