Details On The Longhorn Spool File Format
Outline Metro Packages Reach Package Structure Reach Markup Other Topics
Goals A better understanding of Metro and Reach Packages A better understanding of the XML markup utilized in Reach Packages Where to find the Metro Specification
Metro Packages
What is Metro? Word Document (.doc) Consume in driver or directly in printer as a PDL Publish as fixed digital document Print to printer (Metro spool file) Metro is a document format. The spool file and a page description language (PDL) are built on it.
More on Metro A Metro package that conforms to the spool file format is called a Reach package Reach packages are stored in ZIP containers Reach packages include a fixed payload of XML or binary parts Metro Package Payload Generic Metro Package (ZIP container) Package Relationships Part
Metro Package Fixed Payload Simple Reach Package Composition Parts are streams that include document content necessary to render the Reach package Relationships define part dependencies Package Relationships Part Document XML Parts Document Relationships Parts Resource Parts (e.g. Fonts, Images) Reach Package Relationship
Parts Parts are defined in streams in the container Every part has a name and content type (MIME) Like URIs, part names are hierarchically divided into segments, e.g. /markup/mypart.xml Content types of parts are defined in a specially-named XML stream The pack URI scheme addresses parts in a package Composed as a specially-escaped container URI plus the part name, e.g.: pack:// The pack URI above refers to the part /mypart.xml within the container
Relationships Relationships explicitly identify relationships between parts Parts may internally reference other parts without defining a relationship Relationships are stored in relationship parts A relationship part is attached to another part via naming convention For example, /markup/_rels/mypart.xml.rels is the relationships part for /markup/mypart.xml A relationship may be associated with the package as a whole
Example relationship declaration: <Relationship Target="../tickets/ticket1.xml" ID="A5FFC797514BC" Type=" Target defines the URI of the part referenced ID uniquely identifies the relationship within the relationships part Type specifies a namespace-like definition of the purpose of the relationship Relationship Markup
Reach Package Structure
Fixed Payload The fixed payload contains all the parts needed to render the document and some optional 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 Annotations – Document annotations Some key fixed payload relationships include: StartPart– Points to the document root RequiredResource– Image/font needed to render page PrintTicket– Printer settings
Reach Markup
Markup Syntax Reach markup is XML based on WinFX XAML Imaging model matches the Avalon display model, which provides screen to print fidelity Fully compatible with WinFX markup, but does not require WinFX All markup is specified in well-defined namespaces, primarily: All content is expressed as elements Comments are allowed Bare text between elements is not allowed Content may be specified in element attributes Markup is rendered with the painter’s model, with an alpha Reach markup authors may define named resources, which appear in resource dictionaries and contain reusable element declarations
Property Syntax Properties take 3 forms: Property Attribute Syntax Property Resource Reference Attribute Syntax Property Element Syntax …
Document Markup Documents are composed of 3 core parts The FixedDocumentSequence part is the root of the entire fixed payload and may roll up 1 or more FixedDocuments Each FixedDocument part is the root of an individual set of 1 or more FixedPages The FixedPage part contains all the markup necessary to render a single page
The FixedPage markup is expressed with 3 core elements: The Canvas element is used to group content The Path element is used to render vectors or images The Glyphs element is used to render text <Path Fill="#0000FF" Data="M 10,10 L 125,10 L 125,50 L 10,50 Z" /> <Glyphs OriginX="25" OriginY="35" Fill="#FFFFFF" FontUri="/fonts/Times.TTF" FontRenderingEmSize="16" UnicodeString="This is page 1."/> Page Markup
Graphics Vector graphics are specified in markup by use of the Path element The Path element is defined by certain key properties: Data – Geometric area the graphic occupies Fill– Brush used to fill the geometry Stroke– Brush used to fill the geometry’s edges Opacity– Transparency (alpha) of the graphic Clip– Clipping geometry to apply to the graphic RenderTransform– Affine matrix transformation to apply Some properties have both child property elements and an abbreviated syntax for simple attributes
Geometries Geometries are defined by 3 elements: PathGeometry– Simplest geometry definition CombinedGeometry– Boolean geometry combination element GeometryGroup – Aggregates multiple geometries into one An individual geometry contains PathFigure elements, which are built as a sequence of line and curve segments: StartSegment CloseSegment ArcSegment BezierSegment LineSegment QuadraticBezierSegment PolyBezierSegment PolyLineSegment PolyQuadraticBezierSegment
<LinearGradientBrush MappingMode="Absolute" StartPoint="35,0" EndPoint="87.5,0" SpreadMethod="Reflect"> Graphics Example
Brushes Brushes are used to paint the interior and strokes of Path elements and the character shapes rendered by Glyphs elements Reach packages include 5 brushes: SolidColorBrush– Fills with a solid color ImageBrush– Fills with a specified raster image VisualBrush– Fills with vector graphics or text LinearGradientBrush– Fills with a linear gradient RadialGradientBrush– Fills with a radial gradient
Text The Glyphs element specifies all text in a Reach package The Glyphs element relies on a font part embedded, obfuscated, and optionally subsetted in the package A few core Glyphs properties include: FontUri– Font part used OriginX, OriginY– Position of the baseline origin FontRenderingEmSize– Size to render the glyphs UnicodeString– Contains the text to be rendered StyleSimulations– Simulates bold or italic treatments Fill– Brush used to fill the glyphs Indices– Specifies complex codepoint to glyph mappings, advance widths, and glyph offsets The Glyphs element may also specify a device font ID to enable device fonts
Text Markup Example <Glyphs Fill="#000000" OriginX=“10" OriginY="40" Indices=";;;;;(2:1)191" UnicodeString="Open file" FontUri="/fonts/Times.ttf" FontRenderingEmSize="50">
Other Topics
Other Topics – Print Tickets The PrintTicket part specifies user intent and device configuration information to printing consumers Example settings: JobDuplex DocumentStaple PageOrientation PrintTickets have a hierarchy of settings associated with the fixed payload document elements: Job SettingsFixedDocumentSequence Document SettingsFixedDocument Page SettingsFixedPage Exactly 1 PrintTicket part may be attached to each fixed payload document part PrintTicket settings are inherited down the document hierarchy
Other Topics – Streaming Consumption Authors may write Reach packages in an interleaved fashion If interleaved, the following rules apply: The content of each part may be broken into multiple pieces that may be interleaved with pieces of other parts Content type must be placed before the part it describes Relationship part must appear before the part it is attached to Consumers may discard certain parts (e.g. FixedPage) after it has been fully processed In Reach packages, authors may interleave DiscardControl parts to explicitly instruct consumers when named parts may be discarded
Color Actively working on an end-to-end robust color solution Our goal is to support: sRGB color scRGB color CMYK color N-Channel color Named colors Vector markup Raster file formats Details are not yet available in the Metro Specification
Call To Action Review the Metro v.7 specification Start implementation with Beta 1! Understand Windows codenamed “Longhorn” Print Architecture Identify strategic devices to target the Metro Print Path Identify extension scenarios Understand the Windows Color System Convert GDI/DDI based drivers to MetroDrv drivers Explore the sample filters in Longhorn Beta 2 WDK Consider on-device rendering with a RIP implementation A reference implementation is planned for Longhorn Beta 2 tools
Additional Resources Community Sites MSDN Developer Community Chats: Printer Drivers -- Ask the Experts Online Windows Drivers: Printer Drivers Windows Drivers Printing and Networking Web resources WS-Devices Profile: ?pull=/library/en-us/dnglobspec/html/devprof.asp Printer Working Group WHDC Printing home page: WHDC Still Imaging / WIA home page: Color Use Cases “Writing Effective Use Cases”, Alistair Cockburn, ISBN
Additional Resources For developer print questions: microsoft.com For developer scan questions: microsoft.com For developer color questions: microsoft.com Developer kit references: SDK for Print Schema User Manual and Keywords: us/printschema/PrintSchema/Overviews/PrintSchema_entry.asp WDK for PT/PC interfaces: Reference\Printer Driver and Spooler Component Interfaces\Printer Driver Functions and Structures\Unidrv and Pscript Interfaces\Methods for Job Ticket Providers and Consumers WinFX Print System Object Documentation available in WinFX Beta 1 SDK
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.