IXpsFixedPageWriter Interface

 

Defines methods for writing FixedPage parts to an XPS document.

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

public interface class IXpsFixedPageWriter : IStoryFragmentProvider

NameDescription
System_CAPS_pubpropertyLinkTargetStream

Gets a list of strings that identify the LinkTarget hyperlink points that are contained in the current page.

System_CAPS_pubpropertyPageNumber

Gets the zero-based page number of this page.

System_CAPS_pubpropertyPrintTicket

Sets the default printing options for the page.

System_CAPS_pubpropertyUri

Gets the URI of the fixed page.

System_CAPS_pubpropertyXmlWriter

Gets an XmlWriter for writing XML markup to the page.

NameDescription
System_CAPS_pubmethodAddColorContext()

Adds a new XpsColorContext to the current page.

System_CAPS_pubmethodAddFont()

Adds a new XpsFont to the current page.

System_CAPS_pubmethodAddFont(Boolean)

Adds a new obfuscated XpsFont to the current page.

System_CAPS_pubmethodAddFont(Boolean, Boolean)

Adds a new obfuscated or restricted XpsFont to the current page.

System_CAPS_pubmethodAddImage(String^)

Adds a new XpsImage with a specified MIME type to the current page.

System_CAPS_pubmethodAddImage(XpsImageType)

Adds a new XpsImage with a specified XpsImageType to the current page.

System_CAPS_pubmethodAddResource(Type^, Uri^)

Adds a new XpsResource to the current page.

System_CAPS_pubmethodAddResourceDictionary()

Adds a XpsResourceDictionary to the page.

System_CAPS_pubmethodAddStoryFragment()

Adds a StoryFragments element to an XPS package.(Inherited from IStoryFragmentProvider.)

System_CAPS_pubmethodAddThumbnail(XpsImageType)

Adds a thumbnail image of a specified XpsImageType to the current page.

System_CAPS_pubmethodCommit()

Flushes and closes the fixed-page writer.

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>
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<System::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
Available since 3.0
Return to top
Show: