1 Unleashing The Power Of XPS-Based File Formats For Your Application Jesse McGatha DAT304 Program Manager Microsoft Corporation.

Slides:



Advertisements
Similar presentations
Using Xps Common Scenarios in Xps. Overview PrintingLoadingSerializingManipulating.
Advertisements

Solution Development Using the 2007 Microsoft Office System Open XML File Formats Microsoft Corporation.
Assembling, Repurposing And Manipulating Document Content Using The New Office File Format Brian Jones OFF 304 Program Manager Microsoft Corporation.
Windows Presentation Foundation ("Avalon"): Advances in Document Workflow Automation- Securing, Viewing, and Printing Your Content N. Gregg Brown PRS333.
Microsoft Excel 2003 Illustrated Complete Excel Files and Incorporating Web Information Sharing.
Digital Preservation - Its all about the metadata right? “Metadata and Digital Preservation: How Much Do We Really Need?” SAA 2014 Panel Saturday, August.
ReplicationBackupHSMSecurityArchiveEncryptionExpiration.
1 Lesson 14 Sharing Documents Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Microsoft Office Open XML Formats Brian Jones Lead Program Manager Microsoft Corporation.
Filter-based Print Drivers: Overview. Outline MetroDrv Architecture and Data Flow Filter Pipeline Implementation MetroDrv Filter Development Discussion.
Future Directions for Leveraging Advanced XML Tools and Building Custom XML Solutions Denise Draper DAT321 Microsoft Corporation.
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.
Print Driver And XPSDrv Testing In Windows Vista
New Document Lifecycle Opportunities N. Gregg Brown Lead Program Manager Digital Documents microsoft.com Microsoft Corporation.
Feng Yuan Principal Software Development Engineer 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.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
Microsoft Confidential Gregg Brown| Lead Program Manager Windows Digital Documents Team | Microsoft Corporation XPS Overview and Demonstration.
Module 14: Configuring Print Resources and Printing Pools.
OFC304 Excel 2003 Overview: XML Support Joseph Chirilov Program Manager.
Advances in Windows Printing Daniel Emerson Program Manager Digital Documents Platform and Solutions Microsoft Corporation.
© 2006 Microsoft Corporation. OpenXML et.NET Pierre Lagarde Relation.
1 XML as a preservation strategy Experiences with the DiVA document format Eva Müller, Uwe Klosa Electronic Publishing Centre Uppsala University Library,
Developing Reporting Solutions with SQL Server
Using a Template to Create a Resume and Sharing a Finished Document
Exploiting New Capabilities for Search And Organization Kerem Karatal DAT307 Lead Program Manager Microsoft Corporation.
OFC335 Microsoft Office Word 2007 XML Programmability: True Data/View Separation and Rich Eventing for Custom XML Tristan Davis Program Manager Microsoft.
1. Chapter 25 Protecting and Preparing Documents.
Word Lesson 13 Sharing Documents Microsoft Office 2010 Advanced Cable / Morrison 1.
Module 3 Configuring File Access and Printers on Windows ® 7 Clients.
Open XML Formats Jessica Gruber Consultant Microsoft Corporation.
Module 3: Configuring File Access and Printers on Windows 7 Clients
GPO’s Federal Digital System December 10, 2009 U.S. Government Printing Office.
Storage Device Design Pattern JEFF MEISSNER; KEN HARDY Windows Program Management.
Enhanced Storage Architecture
Lap Around Windows Presentation Foundation Rob Relyea PRS305 Lead Program Manager Windows Presentation Foundation
Open XML Developer Workshop Working with the Packaging API.
Open XML Formats Fabio Santini.NET Developer Evangelist Microsoft Italy.
1 Välkommen till Sommarkollo Windows Presentation Foundation Per Östman ISV Developer Evangelist
Hosting Websites and Web Applications with Microsoft ® SQL Server ® 2008.
Windows Forms in Visual Studio 2005: An in-depth look at key features Name: Joe Stegman Title: Lead Program Manager Session code.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
Longhorn Search and Organize User And Developer Experience Paul Cutsinger – Lead Program Manager Kerem Karatal – Lead Program Manager Microsoft Corporation.
Microsoft’s Rich Web Technology XAML,WPF and WPF/E July, 2006 John Allwright.
IE Developer Tools Jonathan Seitel Program Manager.
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
Open XML Developer Workshop Open XML Packages, Parts and Relationships.
© 2014 IBM Corporation Activity Streams Integration IBM Connections 5.0 Workshop Author: Paul Godby IBM Ecosystem Development Duration: 45 minutes.
5/25/2018 2:39 AM © 2006 Microsoft Corporation. All rights reserved.
Office Open XML Formats: Enabling Solutions
A brief overview of the contribution
Lesson 9 Sharing Documents
Microsoft Dynamics.
Lesson 9 Sharing Documents
Developer Patterns to Integrate Silverlight 4.0 with SharePoint 2010
Microsoft PowerPoint 2007 – Unit 2
Session 2: Metadata and Catalogues
Lesson 14 Sharing Documents
Delivering great hardware solutions for Windows
4/20/2019 Share © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or.
5/8/2019 3:20 AM bQuery-Tool 3.0 A new and elegant way to create queries and ad-hoc reports on your Baan/Infor ERP LN data. This Baan session is a query.
Windows Forms in Visual Studio 2005: An in-depth look at key features
SharePoint 2007 Developer Overview Collaboration BI Features
Presentation transcript:

1 Unleashing The Power Of XPS-Based File Formats For Your Application Jesse McGatha DAT304 Program Manager Microsoft Corporation

2 Session Outline Packages File Format Definitions Developer Scenarios Package Overview (Demo) Package Services Core Properties Digital Signatures (Demo) Rights Management Custom File Formats Solution Development XPS Extensibility

3 Session Goals Understand the basic package architecture Basic package format Package services Explore different formats built on packages XPS Documents Office “12” files (.docx,.pptx,.xlsx) Custom formats Understand the benefits of the architecture TransparencyFlexibilityRobustness Reduced sustained engineering cost Many developer opportunities

4 File Format Definitions XPS: The XML Paper Specification Packages: The foundation of many file formats ZIP Parts and Relationships Abstraction Custom Formats Office “12” Open XML Formats Package Services Open Packaging Conventions Specification XPS Document Format XML Paper Specification

5 Package And XPS Technologies Open Packaging Conventions and XML Paper Specification (XPS) for use by devices and any application on any platform. Open 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 to “Save As” XPS Document Application programming interfaces (APIs) to manage package and content. WinFX APIs Print pipeline with integrated spool format and printer-page description language to speed and improve print jobs fidelity. New driver model. XPS Print Path

6 Developer Scenarios  Build custom file formats  Access XPS Document and Office “12” content directly  Provide document solutions for XPS Document, Office “12” or custom files WinFXAPIs WinFX XPS Document API XPS Document Format WinFX Package API Applications Custom Format Custom APIs Office “12” Open XML Formats

7 Packaging Model Provides foundation of a file format Described in the Open Packaging Conventions Specification v0.75 Usable by any application Multiple implementations underway XPS Document and Office “12” Open XML formats Built on concepts of parts and relationships Parts are streams of data (XML or binary) Relationships describe how parts are related Stored in a ZIP archive

8 Inspecting A Package Using ZIP Utilities

9 Packaging APIs Classes WinFX provides an API to make package manipulation easy API is in System.IO.Packaging namespace Classes of interest PackagePackagePartPackagePartCollectionPackageRelationshipPackageRelationshipCollectionPackUriHelperPackWebRequestPackWebResponse

10 Packaging APIs API Functionality 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

11 Packaging APIs Sample code – read data from package // Open existing package Package package = Package.Open(“C:\Temp\PDCfile.docx”, FileMode.Open); // Find parts based on relationship type string relType = “ PackageRelationshipCollection packRels = package.GetRelationshipsByType(relType); // Assuming there is only one relationship of this type IEnumerator relsEnumerator = packRels.GetEnumerator(); relsEnumerator.MoveNext(); PackageRelationship rel = relsEnumerator.Current; // For this sample, fetch only the first part in this collection PackagePart part = package.GetPart( PackUriHelper.ResolvePartUri( new Uri(“/”, UriKind.Relative), rel.TargetURI)); // Get the stream for this part Stream partStream = part.GetStream();

12 Package Services

13 Common Package Services WinFX provides APIs for common package services Core Properties Digital Signatures Rights Management

14 Core Properties Package may include a set of metadata in a single XML part: The core properties part Discovered by a root relationship with a specific relationship type Uses a specific content type XPS Document and Office “12” files both support core properties Category Content Status ContentType Creator DateCreated DateModified Description Identifier Keywords Language LastModifiedBy LastPrinted Revision Subject Title Version Core Properties XPS Package Relationships Common Package Parts Core Properties

15 Digital Signatures Allow you to validate that the signed content has not been tampered with Available for all package-based file formats Follow well-known standards: Compatible with the XML Digital Signature standard Certificates follow X509 standard Parts signed are determined by the signing policy Example: XPS Document policy is to sign all defined parts and relationships Can be extended by the particular format

16 Digital Signatures Model Signature Origin part is the root of all signatures in the package Each signature located in its own part XPS Package Relationships Common Package Parts Core Properties Signature Origin X509 Cert Signature X509 Cert Signed part Signature Resources Signed Parts RecommendedParts Relationship URI Reference

17 Digital Signatures APIs Classes of interest PackageDigitalSignatureManager: Get, add, or remove a signature to/from the package PackageDigitalSignature Get the list of parts signed by the signature Get the list of references to signed relationships Get the list of signed and unsigned objects in the signature Verify the signature Verify the signature certificate PackageDigitalSignaturePackageDigitalSignatureManager

18 Digital Signatures

19 OLE Property Storage Core Properties RM “envelope” RM Licenses XPS Package Relationships Common Package Parts Core Properties Signature Origin Signature X509 Cert Signature X509 Cert Signed part Rights Management May use any RM solution RM is external to the XPS Specification Windows RMS solution provided with WinFX Allows easy participation in RMS document workflows API wraps the unmanaged RMS API In the System.Security.RightsManagement namespace

20 Custom File Formats

21 Custom File Formats Creating your own Microsoft encourages applications to adopt the packaging model for file management WinFX APIs make this easy Makes building solutions around your application easier Factor your data Decide how to split your application’s data between parts Use XML parts to store data that can be represented textually Use binary parts to store other data For XML parts, define your own namespace

22 Custom File Formats More on creating your own Make use of relationships Define your own relationship types Prefer relationships over inline URI references They are a great way to attach a metadata part to other parts (particularly binary parts) Take advantage of common package services E.g. core properties, digital signatures

23 XPS Document Implementation

24 XPS Document Parts and relationships Key XPS Document parts FixedDocumentSequence – Root of the document FixedDocument – Document XML markup FixedPage – Page XML markup Font – Embedded font Image – Embedded image Thumbnail – Page thumbnail images PrintTicket – Printer settings for page/document DocumentStructure– Semantic structure of document StoryFragments– Semantic structure of page Key XPS Document relationships StartPart– Points to the FixedDocumentSeq. RequiredResource– Image/font needed to render page PrintTicket– Printer settings

25 XPS Document Format XPS Package Relationships 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 Resources OptionalParts Required or RecommendedParts Relationship URI Reference

26 XPS Documents Solution development APIs Supersede package APIs for XPS Document solutions Create, consume, and service XPS Documents Tailored to the specific needs of XPS Documents API is in System.Windows.Xps.Packaging namespace Classes of interest XpsDocumentIDocumentSequenceReaderIDocumentSequenceWriterIFixedDocumentReaderIFixedDocumentWriterIFixedPageReaderIFixedPageWriter

27 XPS Documents API functionality Document manipulation Add/remove documents to document sequence and pages to documents Retrieve or set core properties Retrieve or set thumbnails Add page content E.g. colors, fonts, images, resource dictionaries Retrieve/Set PrintTickets (print job control XML) Digital Signatures Automatically sign according to XPS Document signing policy Specify co-signature requirements

28 XPS Document Extensibility XPS Documents may be extended through the use of markup compatibility Identical to Windows Presentation Foundation (XAML) markup compatibility Designed to support backward and forward compatibility The only proper way to add new features intermixed with XPS Document markup XPS Viewer will reject files with unknown markup

29 XPS Document Markup compatibility XML parts are processed for compatibility during loading Process unknown XML namespaces, elements, and attributes By default, unknown elements/attributes trigger errors Ignorable suppresses errors triggered by elements/attributes in unknown namespaces ProcessContent determines if markup nested within an ignored element should be processed AlternateContent selects a Choice based on Required namespaces MustUnderstand triggers an immediate error when an unknown namespace is specified

30 XPS Document Markup compatibility sample <FixedPage Height="1056" Width="816" xml:lang="en-US" xmlns=" xmlns=" xmlns:mc=" compatibility/2005" xmlns:mc=" compatibility/2005" xmlns:mcext=" xmlns:mcext=" mc:Ignorable="mcext" > mc:Ignorable="mcext" > <Path Stroke="#000000" <Path Stroke="#000000" Data="M 20,70 A 50, ,70 A 50, ,70 Z" /> Data="M 20,70 A 50, ,70 A 50, ,70 Z" /> <Path <Path mcext:Finish="GoldVarnish" mcext:Finish="GoldVarnish" Data="M 20,70 A 50, ,70 A 50, ,70 Z" /> Data="M 20,70 A 50, ,70 A 50, ,70 Z" /> <Path <Path Fill="#C8C800" Fill="#C8C800" Opacity="0.2" Opacity="0.2" Data="M 20,70 A 50, ,70 A 50, ,70 Z" /> Data="M 20,70 A 50, ,70 A 50, ,70 Z" /> </FixedPage>

31 Conclusion

32 Benefits Transparency Really see what is in your files Great for archiving – you don’t need particular applications Flexibility Formats are extensible with custom data Formats can easily be integrated into solutions and workflows Robustness ZIP is recoverable Compression benefits file size Reduced sustained engineering costs Use the WinFX API for managing files rather than a custom API Lots of developer opportunities Open formats do not require integration of the original application to build a solution Packages and XPS Documents a broader part of a full suite of technologies

33 Community Resources At PDC For more information, go see PRS333 – Advances in Document Workflow, Securing, Viewing, and Printing Your Content OFF304 – Developing for the 'Office12' User Experience 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 Package and XPS related information: 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:

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

35 Appendix: Digital Signatures Sample code // Assume package contains the Package to sign PackageDigitalSignatureManager dsm = new PackageDigitalSignatureManager(package); // Get all Parts and add them to the List of Parts to be signed. // Cannot pass GetParts() enumeration directly as it is // invalidated during Sign process. List toSign = new List (); foreach (PackagePart packagePart in package.GetParts()) { toSign.Add(packagePart.Uri); toSign.Add(packagePart.Uri);} // Normally, you wrap this in a try/catch to detect // when no certificates are available... dsm.Sign(toSign); // Prompt user to select a Cert to sign with

36 Appendix: Core Properties Markup sample Jesse McGatha Jesse McGatha PDC Presentation PDC Presentation XML File Formats XML File Formats Presentation Presentation XML;XPS;Office;Format XML;XPS;Office;Format PDC presentation on XML file formats. PDC presentation on XML file formats. Presentation Presentation Final Final /21/ :00:00 07/21/ :00:00 07/22/ :00:00 07/22/ :00:00 Jesse McGatha Jesse McGatha 07/22/ :00:00 07/22/ :00:00 EN-US EN-US DAT011 DAT011 </CoreProperties>