Windows Presentation Foundation ("Avalon"): Advances in Document Workflow Automation- Securing, Viewing, and Printing Your Content N. Gregg Brown PRS333.

Slides:



Advertisements
Similar presentations
RP Designs Semi-Custom e-Commerce Package. Overview RP Designs semi- custom e-commerce package is a complete website solution. Visitors can browse a catalog.
Advertisements

Microsoft Office SharePoint Portal Server 2007 Introduction to InfoPath Forms Services Daryl L. Rudolph.
Using Xps Common Scenarios in Xps. Overview PrintingLoadingSerializingManipulating.
Designing InfoPath Forms: The Dos and Donts Deploying InfoPath Forms: Making the right choice Adding custom business logicin case the built-in stuff isnt.
Microsoft SharePoint 2010 technology for Developers
Designing, Deploying and Managing Workflow in SharePoint Sites Steve Heaney Product Development Manager OBS
1 Lesson 14 Sharing Documents Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
SOFTWARE PRESENTATION ODMS (OPEN SOURCE DOCUMENT MANAGEMENT SYSTEM)
SharePoint 2007: Workflow and Digital Forms Neil Iversen Inetium.
Windows SharePoint Services: Advancements In Document, Content, And Data Storage Dustin Friesenhahn OFF409 Program Manager Microsoft Corporation.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Microsoft Office Open XML Formats Brian Jones Lead Program Manager Microsoft Corporation.
SharePoint Collaboration Features & Workflow
Filter-based Print Drivers: Overview. Outline MetroDrv Architecture and Data Flow Filter Pipeline Implementation MetroDrv Filter Development Discussion.
Adrian Ford Program Manager Microsoft Corporation PC15.
Computer Literacy BASICS: A Comprehensive Guide to IC 3, 5 th Edition Lesson 14 Sharing Documents 1 Morrison / Wells / Ruffolo.
©2011 Quest Software, Inc. All rights reserved. Steve Walch, Senior Product Manager Blog: November, 2011 Partner Training Webcast.
New Document Lifecycle Opportunities N. Gregg Brown Lead Program Manager Digital Documents microsoft.com Microsoft Corporation.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. M I C R O S O F T ® Preparing for Electronic Distribution Lesson 14.
OFC302 Building Smart Document Solutions in Word & Excel Martin Sawicki Lead Program Manager.
Microsoft Confidential Gregg Brown| Lead Program Manager Windows Digital Documents Team | Microsoft Corporation XPS Overview and Demonstration.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 9 User Productivity Tools.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
Overview Features & Functions 07/2013. A family of workflow automation products developed by Konica Minolta’s Solutions Engineering Center Easy-to-use.
Business Solutions Using Microsoft ® Office SharePoint ® Server ROADSHOW.
1 XML as a preservation strategy Experiences with the DiVA document format Eva Müller, Uwe Klosa Electronic Publishing Centre Uppsala University Library,
Exploiting New Capabilities for Search And Organization Kerem Karatal DAT307 Lead Program Manager Microsoft Corporation.
1. Chapter 25 Protecting and Preparing Documents.
Word Lesson 13 Sharing Documents Microsoft Office 2010 Advanced Cable / Morrison 1.
OFC 308 Advanced Word XML: The WordML Schema and Bringing Everything Together Brian Jones Program Manager Authoring Services.
James Akrigg Microsoft Ltd Integrating InfoPath Forms Into Workflow Solutions And Business Processes.
Module 3 Configuring File Access and Printers on Windows ® 7 Clients.
Office Business Applications Workshop Defining Business Process and Workflows.
Module 3 Configuring File Access and Printers on Windows 7 Clients.
Microsoft Dynamics NAV 2009 and Architecture Overview Name Title Microsoft Corporation.
Module 3: Configuring File Access and Printers on Windows 7 Clients
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Office Server Specific Web content management –Page structure, layouts, and controls –Publishing.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
Coding Compliance Components Writing Custom Policies for Auditing, Expiration and More Jason Morrill Program Manager Windows SharePoint Services.
The world leader in serving science Overview of Thermo 21 CFR Part 11 tools Overview of software used by multiple business units within the Spectroscopy.
1 Välkommen till Sommarkollo Windows Presentation Foundation Per Östman ISV Developer Evangelist
1 Unleashing The Power Of XPS-Based File Formats For Your Application Jesse McGatha DAT304 Program Manager Microsoft Corporation.
Package! Publish! Print! Brian Adelberg Digital Document Solutions Software Development Lead Microsoft Corporation.
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring Windows Server 2008 Printing.
Details On The Longhorn Spool File Format. Outline Metro Packages Reach Package Structure Reach Markup Other Topics.
1 Lesson 14 Sharing Documents Computer Literacy BASICS: A Comprehensive Guide to IC 3, 4 th Edition Morrison / Wells.
The 2007 Microsoft Office System Servers Enterprise Content Management, Workflow and Forms Martin Parry Developer and Platform Group, Microsoft Ltd
Workflow in Microsoft Office SharePoint Server Jessica Gruber Consultant Microsoft Corporation.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Yochay Kiriaty Senior Technical Evangelist Microsoft® Corporation
Internet Made Easy! Make sure all your information is always up to date and instantly available to all your clients.
5/25/2018 2:39 AM © 2006 Microsoft Corporation. All rights reserved.
Visual Studio Tools for Office 2005
Lesson 9 Sharing Documents
Microsoft Dynamics.
Customizing your device experience with assigned access
Lesson 9 Sharing Documents
RMS with Microsoft SharePoint
Ambir nSign Presentation Synopsis
Searching Business Data with MOSS 2007 Enterprise Search
Lesson 14 Sharing Documents
Building event-driven, long-running apps with Windows workflow
Microsoft PowerPoint 2007 – Unit 2
LitwareHR v2: an S+S reference application
Lesson 14 Sharing Documents
敦群數位科技有限公司(vanGene Digital Inc.) 游家德(Jade Yu.)
SharePoint Workflow: Taking the Manual Out of Your Process
SharePoint 2007 Developer Overview Collaboration BI Features
Presentation transcript:

Windows Presentation Foundation ("Avalon"): Advances in Document Workflow Automation- Securing, Viewing, and Printing Your Content N. Gregg Brown PRS333 Lead Program Manager Microsoft Corporation

Overview Windows Presentation Foundation Document Technologies Open Document Specifications Open packaging conventions XML Paper Specification (XPS) Document Workflows Windows Workflow Foundation (WWF) and Document Workflow Activities Package Workflow Activities XPS Documents Workflow Activities Document Activities and WWF (Demo)

New Document Technologies Open Packaging Conventions and XML Paper Specification (XPS) for use by devices and any application on any platform. Open Document Specifications A WPF utility that allow users to view, protect and print XPS Documents. Hosted in IE. XPS Viewer A print-to-file converter for creating XPS Documents from any Microsoft Windows-based application. Print Driver for “Save As” Application programming interfaces (APIs) to manage package and content. WPF Document APIs Print pipeline with XPS spool format and printer- page description language to speed and improve print job fidelity. New driver model. XPS Print Path

Open Document Specifications Open Packaging Conventions (Package) Defines conventions for using URI, XML, and Unicode to store content and resources Defines common services for any document: Digital Signatures, Core Properties Defines mapping Package to ZIP archive XML Paper Specification Uses the Open Packaging Conventions Fixed-layout, archivable “Electronic Paper” Specifies markup that is compatible with XAML Native Windows Presentation Foundation print output New spool file added to Windows Vista print architecture

Windows Presentation Foundation (WPF) Document APIs Scenario API Support Application includes viewer control that displays XPS pages and WPF content Use Custom Viewer Activity or application opens package and reads/changes/adds parts and relationships, Digital Signatures and Metadata Create/Use Package Application/activity easily creates XPS file from WPF elements Serialize WPF content to XPS Workflow activity or desktop application edits or creates XPS Documents; includes support for Package services for XPS Documents Create/Use XPS Documents Application interacts with Windows RMS to create or consume Open Packaging Convention documents with restricted permissions Create/Use Documents w/ Restricted Permissions

Shared Package Office "12" and XPS Documents share: Open packaging conventions (package) Common services in the specification: DigSig, Core Properties Services built to work with package: Rights Management ISVs, IT pros and web applications developers can use the same package Use WPF Document APIs Create packages directly using of the shelf ZIP and XML tools Goal: Reduce code/effort required to manage multiple document types

Windows Workflow Foundation And Document Activities

Windows Workflow Foundation Extensible framework and tools for building workflow into Windows applications Common workflow technology for Microsoft products, ISVs and customer solutions A framework to build on – not a server or application Key features Unified model for human and system workflow Extensible activity framework Allows workflows to run in any application or server Visual designer for graphical and code-based authoring Availability Availability Included in WinFX Runtime – powers Office12 workflow

Windows Workflow Foundation Workflows are a set of activities Activities are the building blocks Tasks are human activities Workflows run within a Host Process: any application or server Developers can build their own Custom Activity Libraries Host Process Windows Workflow Foundation Runtime Engine A Workflow An Activity Runtime Services Base Activity Library Custom Activity Library Visual Designer

Office Activity Examples Workflow Workflow History Entry Audit Entry Task Management Create Task Complete task On Task Change Out of Box Tasks Review Task Approval Task Client side scrub task Item Update Item Copy/Delete Item On Item Change Document Sent to Official File Get Range (XL Server) Translate Document Web Send Create alert Validate User Rights Request permissions Front Page Only Calculator Action Create Random Number Render ASPX Page to HTML Assign Survey Task

Automating Workflow Activities Access & Modify Content Add Custom Data New WPF document APIs give automated workflow activities transparent access to document protection, content and resources These APIs allow you to create activities that automate and reduce human task load Digital Signatures Control Access & Permissions

Package Workflow Activities

Package Utility

Using Parts and Relationships Activities that modify content need structured access to the content of the document The open packaging conventions of parts and relationships unify how activities can find or add content OFF304 Office Open XML Formats: Enabling Solutions.xlsx XPS Package Common Package Parts Core Properties Thumbnail Signature Origin Signature X509 Cert Fixed Payload Parts FixedDocumentSequence FixedDocument FixedPage DocumentStructure Font Fonts & Images Thumbnail All parts signed DAT304 XPS-Based File Formats for Your Application.xps Relationships

Packaging APIs System.IO.Packaging Open and close packages Create and delete parts and relationships Get the name, content-type, and stream for parts Read and write part streams Get the ID, type, and target URI for relationships

Finding the Thumbnail (See Demo Code) private Image GetThumbnail() { Package p = Package.Open(_fileName, FileMode.Open, FileAccess.Read); Package p = Package.Open(_fileName, FileMode.Open, FileAccess.Read); //get Thumbnail relationship //get Thumbnail relationship PackageRelationshipCollection relationships = PackageRelationshipCollection relationships = p.GetRelationshipsByType(XpsHelper.PackageThumbnailRelationship); p.GetRelationshipsByType(XpsHelper.PackageThumbnailRelationship); IEnumerator relatEnum = relationships.GetEnumerator(); IEnumerator relatEnum = relationships.GetEnumerator(); PackageRelationship relat = relatEnum.Current; PackageRelationship relat = relatEnum.Current; //get uri of thumbnail pointed to by relationship. //get uri of thumbnail pointed to by relationship. //Assume relationship is not relative to package root //Assume relationship is not relative to package root sourceUri = relat.Source.Uri; sourceUri = relat.Source.Uri; Uri thumbnailUri = PackUriHelper.ResolvePartUri(sourceUri, relat.TargetUri); Uri thumbnailUri = PackUriHelper.ResolvePartUri(sourceUri, relat.TargetUri); PackagePart part = p.GetPart(thumbnailUri); PackagePart part = p.GetPart(thumbnailUri); //get the image stream and content type //get the image stream and content type imgStream = part.GetStream(); imgStream = part.GetStream(); contentType = part.ContentType; contentType = part.ContentType; // Process the thumbnail stream // Process the thumbnail stream... p.Close(); p.Close(); return img; return img; }

Working with Core Properties Core Properties are stored in a specific part Core Properties are available in: XPS Viewer (View XPS Documents only) Windows UI (View/change) Office Applications (View/change for Office “12” Documents) Category Content Status ContentType Creator DateCreated DateModified Description Identifier Keywords Language LastModifiedBy LastPrinted Revision Subject Title Version Core Properties

Package-level Core Properties (See Demo Code) { Package p = Package.Open(doc, FileMode.Open, FileAccess.ReadWrite); Package p = Package.Open(doc, FileMode.Open, FileAccess.ReadWrite); p.CoreProperties.Version = "Final"; p.CoreProperties.Version = "Final"; p.Close(); p.Close();}

Digital Signatures Digital signatures can allow activities to verify that a document: Came from a traceable source The signed content hasn’t changed Package Digital Signature APIs work with collections of parts, relationships, and custom objects embedded in signature Get, set, or clear a signature Validate a signature Get the list of parts, relationships and objects signed Verify the signature certificate System.IO.Packaging / PackageDigitalSignature Use standard XMLDigSig definitions and x509 certificates

Digital Signatures Policy Applications (Word, XPS Viewer) validate a signature according to a specific policy Adding new relationships or parts may break signature, depending on policy Activities can also define simple policies for use within the workflow “Sign all parts and relationships before archiving”

Control Access & Permissions Package Rights Management APIs allow activities to define who has which permissions to packaged documents as the workflow progresses Systems.IO.Packaging / EncryptedPackage APIs depend on Windows RMS V1 SP1 SDK System.Securitry.RightsManagement / UnsignedPublishLicense Office “12” and XPS Documents support Read, Print, Copy, Full Control Each permission may have an expiration date

Example Package Activities Access Activities Extract content Add custom data Merge custom data (“mailmerge”) Find documents by Keyword/Core Property value Get/Set Core Property value Digital Signatures Sign Sign With Policy Verify Signature Validate Certificate Rights Management Open Rights Managed Document Grant Permissions by User Get/Set Core Property value Rights Managed

XPS Documents Workflow Activities

Scanning to XPS Document

OCR Scanned XPS Document

XPS Documents (.xps in Beta2) provide additional services for automated workflow activities Access contentAccess content OutputOutput Document assemblyDocument assembly Round-trip signatureRound-trip signature ArchiveArchive XPS Document Workflow Activities.xps

Accessing XPS Document Content XPS Document APIs provide additional support for activities that work with XPS Documents (.xps) Fixed Documents/Fixed Pages Fonts, Images, Thumbnails Systems.Windows.Xps.Packaging Optional XPS Document structure links related story fragments Systems.Windows.Documents.DocumentStructure

Output XPS Documents Knowledge workers create XPS Documents from any Windows application by printing to the Microsoft XPS Document Writer (MXDW) print driver Driver starts XPS Viewer to define permissions, signatures Win32 applications can create XPS Documents by using MXDW in DevMode

XAML Output to XPS PRSHOL12-WinFX Printing and Archiving WPF applications can create.xps output directly from arbitrary XAML content Example creates.xps from flow (Ex. 3, Task 1-3) System.Printing.PrintSubSystem / XPSDocumentWriter public void ArchiveSingleFlowContentDocument() { IDocumentPaginator idp = _xpfContent.CreateFlowDocument(); IDocumentPaginator idp = _xpfContent.CreateFlowDocument(); _containerPackage = null; _containerPackage = null; File.Delete(fileName); File.Delete(fileName); _containerPackage = Package.Open(fileName, FileMode.Create); _containerPackage = Package.Open(fileName, FileMode.Create); XpsDocument xpsDoc = new XpsDocument(_containerPackage); XpsDocument xpsDoc = new XpsDocument(_containerPackage); XpsDocumentWriter xpsdw = XpsDocument.CreateXpsDocumentWriter(xpsDoc); XpsDocumentWriter xpsdw = XpsDocument.CreateXpsDocumentWriter(xpsDoc); xpsdw.Write(idp); xpsdw.Write(idp); _containerPackage.Close(); _containerPackage.Close(); }

Output to Other Formats Developers can add support for third party serializers that convert WPF classes to another format Serializers are installed as full-trust applications Installed serializers can access any WPF class APIs supports enumerating and invoking installed serializers Enumeration includes XpsDocumentWriter System.Windows.Documents.Serialization (Beta 2)

XPS Document Signature Policies XPS Document signatures define policies to exclude specific parts, allowing users to Change Core Properties Add a new Signature Add Annotations (reserved for future) XPS Viewer will warn users of changes that may break signature

Signing an XPS Document PRSHOL11-Programming XPS Documents Defined policy makes signing.xps easy Example signs.xps with no exclusions (Exercise 4, Task 1-3) Systems.Windows.Xps.Packaging / XpsDigitalSignature System.Security.Cryptography.X509Certificates public static void SignDigitally(string dstContainer, string certFilename) { XpsDocument document = new XpsDocument(dstContainer, XpsDocument document = new XpsDocument(dstContainer, FileAccess.ReadWrite); FileAccess.ReadWrite); X509Certificate certificate = X509Certificate certificate = X509Certificate.CreateFromCertFile(certFilename); X509Certificate.CreateFromCertFile(certFilename); document.SignDigitally(certificate, true, document.SignDigitally(certificate, true, XpsDigSigPartAlteringRestrictions.None); XpsDigSigPartAlteringRestrictions.None); }

Multiple Signer Activities XPS Documents can include a signature definition part that defines: Suggested intent of the signature Requested signer Requested “sign-by” date Suggested local Signature spot location System.Windows.Xps.Packaging / XpsSignatureDefinition XPS Viewer will display signature request

Example XPS Document Activities Watermark pages Get Page, Image, Thumbnail Get Story Redact (Find string and Replace) Remove content not specified in XPS Document format Print XPS Document Assemble from multiple.xps Sign with XPS Document policy Add signature request

Viewing XPS Content XPS Viewer is an integrated WinFX utility Hosted in IE 6, 7 Publish and consume XPS Documents with restricted permissions Digital Signature validate, verify certificates and request signature (Beta2) Loads XPS-specified subset of XAML Refuses to load document containing unknown content in XPS content types Follows XAML markup compatibility rules (Beta2) Non-XPS parts are ignored (Beta2)

Building a Custom Viewer PRSHOL27 – Extending the XPS Document Viewing Experience Custom viewers built with DocumentViewer can display any XPS Document (Exercise 4, Task 1-3)... XpsDocument xpsDoc = new XpsDocument(filename, FileAccess.Read); XpsDocument xpsDoc = new XpsDocument(filename, FileAccess.Read); DocumentViewer docViewer = new DocumentViewer(); DocumentViewer docViewer = new DocumentViewer(); docViewer.Document = xpsDoc.GetPackageRoot(); docViewer.Document = xpsDoc.GetPackageRoot();......

Document Activities and WWF

New Document Opportunities Shared package reduces complexity of managing XPS/Office/3 rd party documents New WPF APIs let you automate content and management tasks to reduce human task load Using XPS Documents is an easy way to assemble, share and archive document content WPF document APIs create new opportunities for customers and partners to create WWF activities for as building blocks for document workflows

Community Resources At PDC For more information, go see OFF415 – Developing Custom Workflows in Office “12” “Presentation” Track Lounge Hands on Labs PRSHOL27 Extend the XPS Document Viewing Experience PRSHOL12 WinFX Printing and Archiving PRSHOL11 Programming XPS Documents After PDC If you missed this related session, watch it on the DVD DAT304 – Unleashing the Power of XPS-Based File Formats for Your Application OFF304 – Developing for the Office “12” User Experience XPS related information and Specifications XPS conformance test suite planned for Windows Vista WDK Beta 2 Office Open XML formats Office Preview Site: Brian Jones’s Blog: Office 2003 Reference Schema Information:

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

Appendix: Search XPS Indexing services (iFilters) are provided for XAML part content and metadata Extensible to other content in package Windows and Office Server search use same index service Search can be used to collect set of documents with Common or specific core property values Containing words or phrases

Appendix: Package-level Signing From the Demo { Package p = Package.Open(doc, FileMode.Open, FileAccess.ReadWrite); Package p = Package.Open(doc, FileMode.Open, FileAccess.ReadWrite); //Create a Digital SIgnature Manager //Create a Digital SIgnature Manager PackageDigitalSignatureManager dsm = new PackageDigitalSignatureManager(p); PackageDigitalSignatureManager dsm = new PackageDigitalSignatureManager(p); // Get all Parts and add them to the List of Parts to be signed. // Get all Parts and add them to the List of Parts to be signed. // Cannot pass GetParts() enumeration directly as it is // Cannot pass GetParts() enumeration directly as it is // invalidated during Sign process. // invalidated during Sign process. List toSign = new List (); List toSign = new List (); // No signing policy defined for XPS Packages, just sign everything // No signing policy defined for XPS Packages, just sign everything foreach (PackagePart packagePart in p.GetParts()) foreach (PackagePart packagePart in p.GetParts()){toSign.Add(packagePart.Uri);} //Sign Collection //Sign Collection dsm.Sign(toSign, cert); dsm.Sign(toSign, cert); p.Close(); p.Close();}

class RmProtectContent { //Open xrml file and read xrml data to string xrmlString //Open xrml file and read xrml data to string xrmlString //Build secure environment //Build secure environment secureEnv = SecureEnvironment.InitSecureEnvironment(_applicationManifest, secureEnv = SecureEnvironment.InitSecureEnvironment(_applicationManifest, new User(_currenUserId, AuthenticationType.Windows)); new User(_currenUserId, AuthenticationType.Windows)); //Build UnsignedPublishLicense from xrml string //Build UnsignedPublishLicense from xrml string UnsignedPublishLicense upl = new UnsignedPublishLicense(xrmlString); UnsignedPublishLicense upl = new UnsignedPublishLicense(xrmlString); User author = upl.Owner; User author = upl.Owner; //Sign the UnsignedPublishLicense to build the PublishLicense //Sign the UnsignedPublishLicense to build the PublishLicense UseLicense authorsUseLicense; UseLicense authorsUseLicense; PublishLicense publishLicense = upl.Sign(secureEnv, out authorsUseLicense); PublishLicense publishLicense = upl.Sign(secureEnv, out authorsUseLicense); //Bind the author's UseLicnse to get the CryptoProvider //Bind the author's UseLicnse to get the CryptoProvider BindingFailure errorCode; BindingFailure errorCode; CryptoProvider cryptoProvider = authorsUseLicense.Bind(secureEnv, out errorCode); CryptoProvider cryptoProvider = authorsUseLicense.Bind(secureEnv, out errorCode); //Create a EncryptedPackage object to RM protect the contents //Create a EncryptedPackage object to RM protect the contents Stream packageStream = File.OpenRead(xpsExistingFile); Stream packageStream = File.OpenRead(xpsExistingFile); EncryptedPackage ePackage = EncryptedPackage.CreateFromPackage(xpsNewFile, EncryptedPackage ePackage = EncryptedPackage.CreateFromPackage(xpsNewFile, packageStream, publishLicense, cryptoProvider); packageStream, publishLicense, cryptoProvider); //Add in a UseLicense for the author //Add in a UseLicense for the author RightsManagementInformation rmi = ePackage.RightsManagementInformation; RightsManagementInformation rmi = ePackage.RightsManagementInformation; rmi.SaveUseLicense(author, authorsUseLicense); rmi.SaveUseLicense(author, authorsUseLicense); ePackage.Close(); ePackage.Close(); } Appendix: Protecting a Document

Appendix: Assembling.xps XPS Document FixedDocumentSequence allows multiple documents to be rolled-up into a single XPS Document Resulting document is a continuous set of pages One core property definition Signatures not preserved

Appendix: Document Assembly FixedDocumentSequence MergeXpsDocuments(FixedDocumentSequence[] xpsDocs) FixedDocumentSequence MergeXpsDocuments(FixedDocumentSequence[] xpsDocs) { FixedDocumentSequence docSeqOut = new FixedDocumentSequence(); FixedDocumentSequence docSeqOut = new FixedDocumentSequence(); foreach (FixedDocumentSequence ds in xpsDocs) foreach (FixedDocumentSequence ds in xpsDocs) { foreach (DocumentReference dr in ds.References) foreach (DocumentReference dr in ds.References) { DocumentReference docRef = new DocumentReference(); DocumentReference docRef = new DocumentReference(); FixedDocument fixedDoc = new FixedDocument(); FixedDocument fixedDoc = new FixedDocument(); foreach (PageContent pc in dr.GetDocument(false).Pages) foreach (PageContent pc in dr.GetDocument(false).Pages) { PageContent pageContent = new PageContent(); PageContent pageContent = new PageContent(); FixedPage fixedPage = pc.GetPageRoot(false); FixedPage fixedPage = pc.GetPageRoot(false); ((System.Windows.Serialization.IAddChild)pageContent).AddChild(fixedPage); ((System.Windows.Serialization.IAddChild)pageContent).AddChild(fixedPage); fixedDoc.Pages.Add(pageContent); fixedDoc.Pages.Add(pageContent); } docRef.SetDocument(fixedDoc); docRef.SetDocument(fixedDoc); docSeqOut.References.Add(docRef); docSeqOut.References.Add(docRef); } } return docSeqOut; return docSeqOut; } void SaveXpsDocument(Document doc, string fileName) {... } {... }