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

The IXpsFixedPageWriter type exposes the following members.

  NameDescription
Public propertyLinkTargetStreamGets a list of strings that identify the LinkTarget hyperlink points that are contained in the current page.
Public propertyPageNumberGets the zero-based page number of this page.
Public propertyPrintTicketSets the default printing options for the page.
Public propertyUriGets the URI of the fixed page.
Public propertyXmlWriterGets an XmlWriter for writing XML markup to the page.
Top

  NameDescription
Public methodAddColorContextAdds a new XpsColorContext to the current page.
Public methodAddFont()Adds a new XpsFont to the current page.
Public methodAddFont(Boolean)Adds a new obfuscated XpsFont to the current page.
Public methodAddFont(Boolean, Boolean)Adds a new obfuscated or restricted XpsFont to the current page.
Public methodAddImage(String)Adds a new XpsImage with a specified MIME type to the current page.
Public methodAddImage(XpsImageType)Adds a new XpsImage with a specified XpsImageType to the current page.
Public methodAddResourceAdds a new XpsResource to the current page.
Public methodAddResourceDictionaryAdds a XpsResourceDictionary to the page.
Public methodAddStoryFragmentAdds a StoryFragments element to an XPS package. (Inherited from IStoryFragmentProvider.)
Public methodAddThumbnailAdds a thumbnail image of a specified XpsImageType to the current page.
Public methodCommitFlushes and closes the fixed-page writer.
Top

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()

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft