IXpsFixedPageReader Interface

 

Defines methods for reading the parts of a FixedPage.

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

Public Interface IXpsFixedPageReader
	Inherits IStoryFragmentProvider

NameDescription
System_CAPS_pubpropertyColorContexts

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

System_CAPS_pubpropertyFonts

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

System_CAPS_pubpropertyImages

Gets a collection of all the images on the page.

System_CAPS_pubpropertyPageNumber

Gets the page number.

System_CAPS_pubpropertyPrintTicket

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

System_CAPS_pubpropertyResourceDictionaries

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

System_CAPS_pubpropertyStoryFragment

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

System_CAPS_pubpropertyThumbnail

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

System_CAPS_pubpropertyUri

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

System_CAPS_pubpropertyXmlReader

Gets an XmlReader for the page.

NameDescription
System_CAPS_pubmethodAddStoryFragment()

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

System_CAPS_pubmethodGetColorContext(Uri)

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

System_CAPS_pubmethodGetFont(Uri)

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

System_CAPS_pubmethodGetImage(Uri)

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

System_CAPS_pubmethodGetResource(Uri)

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

System_CAPS_pubmethodGetResourceDictionary(Uri)

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

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.

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

.NET Framework
Available since 3.0
Return to top
Show: