XpsDocument.FixedDocumentSequenceReader Property
.NET Framework 4.5
Gets an IXpsFixedDocumentSequenceReader for reading the document.
Namespace: System.Windows.Xps.Packaging
Assembly: ReachFramework (in ReachFramework.dll)
Property Value
Type: System.Windows.Xps.Packaging.IXpsFixedDocumentSequenceReaderAn IXpsFixedDocumentSequenceReader for reading the document.
Although this class uses a singular name, an XpsDocument can be a set (sequence) of one FixedDocument or multiple documents.
The following example shows how to get a FixedDocumentSequenceReader in order to access FixedDocument parts in an XpsDocument.
ShowStatus(" Getting FixedDocumentSequenceReader."); IXpsFixedDocumentSequenceReader fixedDocSeqReader = xpsDocument.FixedDocumentSequenceReader; ShowStatus(" Getting FixedDocumentReaders."); ICollection<IXpsFixedDocumentReader> fixedDocuments = fixedDocSeqReader.FixedDocuments; ShowStatus(" Getting FixedPageReaders."); IEnumerator<IXpsFixedDocumentReader> enumerator = fixedDocuments.GetEnumerator(); enumerator.MoveNext(); ICollection<IXpsFixedPageReader> fixedPages = enumerator.Current.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]) + "'"); try { // 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); break; } // Copy the page structure to the new StoryFragment. WriteResource(pageStructure, _fixedPageStructures[i++]); } ShowStatus(" Saving and closing the new document.\n"); xpsDocument.Close();
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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.