IXpsFixedDocumentSequenceReader Interface

IXpsFixedDocumentSequenceReader Interface

 

Defines methods for reading the parts of a FixedDocumentSequence.

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

Public Interface IXpsFixedDocumentSequenceReader

NameDescription
System_CAPS_pubpropertyFixedDocuments

Gets a collection of FixedDocument readers for each document in a FixedDocumentSequence.

System_CAPS_pubpropertyPrintTicket

Gets the PrintTicket, if one exists, that is associated with the FixedDocument.

System_CAPS_pubpropertyThumbnail

Gets the thumbnail image, if one exists, that is associated with the FixedDocumentSequence.

System_CAPS_pubpropertyUri

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

NameDescription
System_CAPS_pubmethodGetFixedDocument(Uri)

Gets a reader for the FixedDocument with the specified uniform resource identifier (URI). 

The following example shows how to obtain a reference to an object that implements this interface.


Private Sub SignatureDefinitionCommandHandler(ByVal sender As Object, ByVal e As RoutedEventArgs)
	Dim sigDefDialog As New SignatureDefinition()
	If sigDefDialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
		Dim signatureDefinition As New XpsSignatureDefinition()
		signatureDefinition.RequestedSigner = sigDefDialog.RequestedSigner.Text
		signatureDefinition.Intent = sigDefDialog.Intent.Text
		signatureDefinition.SigningLocale = sigDefDialog.SigningLocale.Text
		Try
			signatureDefinition.SignBy = Date.Parse(sigDefDialog.SignBy.Text)
		Catch e1 As FormatException
		End Try
		signatureDefinition.SpotId = Guid.NewGuid()
		Dim docSeq As IXpsFixedDocumentSequenceReader = _xpsDocument.FixedDocumentSequenceReader '_xpsDocument is type System.Windows.Xps.Packaging.XpsDocument
		Dim doc As IXpsFixedDocumentReader = docSeq.FixedDocuments(0)
		doc.AddSignatureDefinition(signatureDefinition)
		doc.CommitSignatureDefinition()
		InitializeSignatureDisplay()
	End If
End Sub

The following example shows how to obtain a FixedDocumentSequenceReader in order to access FixedDocument parts in an XpsDocument.

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:
© 2016 Microsoft