Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IXpsFixedDocumentReader Interface

IXpsFixedDocumentReader Interface

Defines methods for reading the parts of a FixedDocument and also for limited types of writing to the document.

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

public interface IXpsFixedDocumentReader : IDocumentStructureProvider

The IXpsFixedDocumentReader type exposes the following members.

Public propertyDocumentNumberGets the zero-based position of the document in the FixedDocumentSequence.
Public propertyDocumentStructureGets the DocumentStructure part, if one exists, of the FixedDocument.
Public propertyFixedPagesGets a collection of FixedPage readers, one reader for each page in the FixedDocument.
Public propertyPrintTicketGets the PrintTicket, if one exists, that is associated with the FixedDocument.
Public propertySignatureDefinitionsGets a collection of all the signature definitions that are associated with the FixedDocument.
Public propertyThumbnailGets the thumbnail image, if a thumbnail exists, that is associated with the FixedDocument.
Public propertyUriGets the uniform resource identifier (URI) of the FixedDocument.

Public methodAddDocumentStructureAdds theDocumentStructure part of XML Paper Specification (XPS) to an XPS package. (Inherited from IDocumentStructureProvider.)
Public methodAddSignatureDefinitionAdds the specified XpsSignatureDefinition to the FixedDocument.
Public methodCommitSignatureDefinitionFlushes the package Stream and also commits an XpsSignatureDefinition to the package.
Public methodGetFixedPageGets a reader for the FixedPage with the specified uniform resource identifier (URI).
Public methodRemoveSignatureDefinitionRemoves the specified XpsSignatureDefinition from the FixedDocument.

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

        private void SignatureDefinitionCommandHandler(object sender, RoutedEventArgs e)
            SignatureDefinition sigDefDialog = new SignatureDefinition();
            if (sigDefDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                XpsSignatureDefinition signatureDefinition = new XpsSignatureDefinition();
                signatureDefinition.RequestedSigner = sigDefDialog.RequestedSigner.Text;
                signatureDefinition.Intent = sigDefDialog.Intent.Text;
                signatureDefinition.SigningLocale = sigDefDialog.SigningLocale.Text;
                    signatureDefinition.SignBy = DateTime.Parse(sigDefDialog.SignBy.Text);
                catch (FormatException)
                signatureDefinition.SpotId = Guid.NewGuid();
                IXpsFixedDocumentSequenceReader docSeq = _xpsDocument.FixedDocumentSequenceReader; //_xpsDocument is type System.Windows.Xps.Packaging.XpsDocument
                IXpsFixedDocumentReader doc = docSeq.FixedDocuments[0];

The following example shows how to use an IXpsFixedDocumentReader to obtain an IXpsFixedDocumentReader collection in order to access each page in a FixedDocument.

ShowStatus("   Getting FixedDocumentSequenceReader.");
IXpsFixedDocumentSequenceReader fixedDocSeqReader =

ShowStatus("   Getting FixedDocumentReaders.");
ICollection<IXpsFixedDocumentReader> fixedDocuments =

ShowStatus("   Getting FixedPageReaders.");
IEnumerator<IXpsFixedDocumentReader> enumerator =
ICollection<IXpsFixedPageReader> fixedPages =

// Add a document structure to each fixed page. 
int i = 0;
foreach (IXpsFixedPageReader fixedPageReader in fixedPages)
    XpsResource pageStructure;
    ShowStatus("   Adding page structure resource:\n       '" +
                       Filename(_fixedPageStructures[i]) + "'");
    {   // Add a new StoryFragment to hold the page structure.
        pageStructure = fixedPageReader.AddStoryFragment();
    catch (System.InvalidOperationException)
        MessageBox.Show(xpsUnstructuredFile +
            "\n\nDocument structure cannot be added.\n\n" +
            Filename(xpsUnstructuredFile) + " might already " +
            "contain an existing document structure.",
            "Cannot Add Document Structure",
            MessageBoxButton.OK, MessageBoxImage.Error);

    // Copy the page structure to the new StoryFragment.
    WriteResource(pageStructure, _fixedPageStructures[i++]);

ShowStatus("   Saving and closing the new document.\n");

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft