XPS Rasterization Service in Windows 7

Slides:



Advertisements
Similar presentations
In InDesign, you can create a new file by pressing Command/Control-N.
Advertisements

Universal Printer Description Format UPDF. UPDF Version 1.0 Agenda UPDF Overview –History –Design Last Call –Review changes –Approval or requirements.
Vector Printer Driver API Update Osamu MIHARA OpenPrinting WG Japan/Asia Fuji Xerox Printing Systems Co. Ltd November 2004.
Using Xps Common Scenarios in Xps. Overview PrintingLoadingSerializingManipulating.
Windows Server Terminal Services Easy Print
Graphics Pipeline.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Module 10 WPF 2-D Graphics, Multimedia, and Printing.
Java2 Printing API Jean-Cédric Desrochers March 9, 2000.
Objectives Define photo editing software
Printer Driver Development in Windows 7
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
2.01 Understand Digital Raster Graphics
Vector vs. Bitmap SciVis V
Print Driver Testing Tools Ashwin Needamangala Senior Test Development Lead Documents and Printing Team
OpenGL Pixel Operations, Bitmaps, Fonts and Images The Current Raster Position Current raster position: A position in window coordinates where the next.
V Obtained from a summer workshop in Guildford County July, 2014
Developing XPSDrv Print Drivers
Filter-based Print Drivers: Overview. Outline MetroDrv Architecture and Data Flow Filter Pipeline Implementation MetroDrv Filter Development Discussion.
Print Verifier Ashwin Needamangala Senior Test Development Lead Documents and Printing Team
HTML Overview for Proofreading. HTML layouts are divided into sections, and created in tables separating the images & content sections.
XPSDrv Best practices using Print Verifier
Windows Server 2008 Chapter 6 Last Update
New Document Lifecycle Opportunities N. Gregg Brown Lead Program Manager Digital Documents microsoft.com Microsoft Corporation.
Bitmapped Images. Bitmap Images Today’s Objectives Identify characteristics of bitmap images Resolution, bit depth, color mode, pixels Determine the most.
1 Windows Vista: Enabling Parental Controls in your Application Brian Trenbeath FUN304 Program Manager Microsoft Corporation.
OM. Brad Gall Senior Consultant
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.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 9 User Productivity Tools.
Advances in Windows Printing Daniel Emerson Program Manager Digital Documents Platform and Solutions Microsoft Corporation.
Chapter 6 Configuring Windows Server 2008 Printing
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Microsoft Windows 7 - Illustrated Unit P Managing Hardware.
Slide 1 of 24 1) Launch Fireworks 2) Under File, choose New 3) In the New Document dialog box, enter Width: 100, Height 160, Resolution 72, and choose.
Core Printer Driver Improvements
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved CheckWriter Application Introducing Graphics and Printing.
Creating Buttons – Lesson 51 Creating Buttons Lesson 5.
Adobe Photoshop CS5 – Illustrated Unit A: Getting Started with Photoshop CS5.
Intro to Datazen.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 9 User Productivity Tools.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
.NET Mobile Application Development XML Web Services.
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.
Scanner Scanner Introduction: Scanner is an input device. It reads the graphical images or line art or text from the source and converts.
Adobe Photoshop CS4 – Illustrated Unit A: Getting Started with Photoshop CS4.
Guilford County SciVis V104.03
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
Multimedia and weBLOGging Grade 7-9 | Cahaya Bangsa Classical School (C) 2010 Digital Media Production Facility 03 - Still Picture 01 – Basics.
Introduction To GDI GDI Definition : It is a interface present in windows which provide function and related structures that an application can use to.
Photoshop CS6 – Nelson Unit 3: Photoshop CS6. Objectives Define photo editing software Start Photoshop and view the workspace Use the Zoom tool and the.
UNITS OF MEASUREMENT 2.01 Understand Digital Raster Graphics.
Getting Started with Adobe Photoshop CS6
2.01 Understand Digital Raster Graphics
Vector vs. Bitmap.
Inserting and Working with Images
Poster Title 108pt Arial Bold
Units of Measurement, Image Resolution, & Color Mode
Building beautiful and interactive apps with HTML5 & CSS3
Made by Aistė Augustinaitė Software Engineering 3 group
DREAMWEAVER MX 2004 Chapter 3 Working with Tables
2.01 Understand Digital Raster Graphics
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
IT Essentials PC Hardware and Software 4
Cascading Style Sheets
Windows Forms in Visual Studio 2005: An in-depth look at key features
Presentation transcript:

XPS Rasterization Service in Windows 7 Georgi Chalakov Senior Software Development Engineer Microsoft Corporation georgi.chalakov@microsoft.com

Agenda XPSDrv Print Driver Architecture XPS Rasterization Service (XPSRas) XPS Rasterizer Object Banding, Caches and Threads XPSRas API Q & A

XPSDrv Print Driver Architecture

XPSDrv Print Driver Architecture WinHEC 2006 XPSDrv Print Driver Architecture Application Process GDI Print App XPS Print App Spooler Process Filter Pipeline Process Version 3 Driver Filter Pipeline Manager Config Module/ Plug-in Filter 1 XPS Spool file Conversion Render Module Filter 2 Property Bag FP Config XML Filter N Provided by: ISV IHV Microsoft © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Filter Pipeline Manager WinHEC 2006 Filter Pipeline Filter Pipeline Process Filter Pipeline Manager XPS Object Model Filter 1 Filter M FP Config XML Property Bag XPS Rasterization Service Filter N Provided by: ISV IHV Microsoft © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

XPS Rasterization Service

XPS Rasterization Service In-box component in Windows 7 Converts XPS Object Model (XPSOM) to WIC images Simplifies the design of an XPSDrv filter High printing fidelity Fast rasterization - uses next generation 2D rasterizers in Windows 7 Access to the service is through Print Filter Pipeline only

XPS Rasterization Service XPS Rasterization Service (XPSRas) Next Gen Rasterization Next Gen Font Management XPS Object Model (XPSOM) Windows Imaging Component (WIC) XPS OPC Service Windows Color Management System (WCMS)

XPS Rasterization Service Filter N XPS OM WIC Image Cancel/Continue XPS Rasterization Service

XPS Rasterization Step by Step Obtain XPS Rasterization Factory from the Property Bag. Create XPS Rasterization Object for an XPS OM Fixed Page. Rasterize a rectangle from the page. Rasterize next rectangle from the page. . . Rasterize the last rectangle from the page. Release XPS Rasterization Object.

1. Obtaining the XPS Rasterization Factory The Print Filter Pipeline Manager calls the filter and passes the property bag as an input parameter. The call sequence: The pipeline manager calls IPrintPipelineFilter::InitializeFilter The filter calls IPrintPipelinePropertyBag::GetProperty MS_IXpsRasterizationService The filter calls IUnknown::QueryInterface for IXpsRasterizationFactory

Code Sample IHV_CreateRasterizationFactory HRESULT __in IPrintPipelinePropertyBag  *pPropertyBag, __out IXpsRasterizationFactory  **ppXPSRasFactory ) { HRESULT hr; // Retrieve the factory object from the property bag. VARIANT var; VariantInit(&var); hr = pPropertyBag->GetProperty( L"MS_IXpsRasterizationFactory“, &var ); //continued on the next slide

Code Sample IHV_CreateRasterizationFactory //continued from the previous slide IXpsRasterizationFactory *pXPSRasFactory; if (SUCCEEDED(hr)) { // Get the factory object's IXpsRasterizationFactory interface. IUnknown *pUnknown = var.punkVal; hr = pUnknown->QueryInterface( __uuidof(IXpsRasterizationFactory), reinterpret_cast<void**>(&pXPSRasFactory) ); } // Give the caller our reference to the IXpsRasterizationFactory interface. *ppXPSRasFactory = pXPSRasFactory;¯ VariantClear(&var); return hr;

XPS Rasterization Object

2. Create XPS Rasterization Object XPS Rasterization object is created with following parameters: XPS OM Fixed Page Rasterization DPI (dots per inch) Glyphs rendering mode – aliased/anti-aliased. Non glyphs rendering mode – aliased/anti-aliased. XPS Rasterization object is bound to the XPS OM Fixed Page and it cannot be reused across pages. XPS Rasterization can be called many times to rasterize axis-aligned rectangles from the page.

Code Sample IHV_CreateRasterizationObject HRESULT __in IXpsRasterizationFactory  *pXPSRasFactory, __in IXpsOMPage *pXPSOMPage, __out IXpsRasterizer **ppXPSRasObject ) { HRESULT hr; hr =  pXPSRasFactory->CreateRasterizer( pXPSOMPage, // XPS OM Fixed Page 600.0f, // DPI XPSRAS_RENDERING_MODE_ALIASED, // non text rendering mode XPSRAS_RENDERING_MODE_ANTIALIASED, // text rendering mode &ppXPSRasObject // the rasterization object ); return hr; }

3. Rasterizing Axis-Aligned Rectangle -x,-y Bleed Box XPS Rasterization object can be called many times to rasterize different axis-aligned rectangles from the page The rectangle is represented with integer numbers and it is in device coordinate space The content on the bleed box can be rasterized using a position outside the fixed page Bleed Box 0,0 Fixed Page width, height

3. Rasterizing Axis-Aligned Rectangle The result is a new Windows Image Component (WIC) bitmap The image is initially cleared with white full transparent color clear color: R=1, G=1, B=1, A=0 The image format is GUID_WICPixelFormat32bppPBGRA Pre-multiplied alpha 32bpp - 8 red, 8 green, 8 blue, 8 alpha

Code Sample IHV_RasterizeRect HRESULT IHV_RasterizeRect( IXpsRasterizer *pXPSRasObject, RECT const &rect, IWICBitmap **ppBitmap ) { HRESULT  hr; hr =  pXPSRasObject->RasterizeRect ( rect.left,, // x rect.top, // y rect.right-rect.left, // width rect.bottom-rect.top, // height NULL, // cancel interface &ppBitmap // result ); return hr; }

Rasterization Cancel Interface interface IXpsRasterizerNotificationCallback : IUnknown { HRESULT Continue(); } It is called quite often. It is called from the same thread where RasterizeRect is called If the client returns a failure HRESULT, the rasterization is canceled and RasterizeRect returns the same HRESULT. After rasterization is canceled, the rasterization object is still valid.

Banding, Caches and Threads

Banding and Caches Banding is the main scenario and the service is optimized for calling RasterizeRect for a sequence of bands. Anything that doesn’t intersect with the requested axis-aligned rectangles is skipped early in the process of the rasterization. Any resource—font/image/brush—most likely will be cached for a while between rasterizing calls. First rasterization call is more expensive than the following rasterization calls on the same fixed page.

Rendering Transformations on the Fixed Page Scaling is supported per page by providing a DPI Translation is supported per rasterizing call by positioning the rasterized rectangle. For an arbitrary transformation, the XPS object model can be modified before the rasterization object is created. Any transformation can be applied to the XPS OM page by wrapping the page in a canvas

Thread Safety Calling the same XPS Rasterization object concurrently from different threads is not supported. Rasterizing the same page from the different XPS Rasterization object is supported—you can create more than one object per XPS OM fixed page. Canceling is immediate. There is no synchronization and there is no separate thread. XPS Rasterization Service calls the cancel interface from the same thread that calls RasterizeRect.

XPS Rasterization API

XPS Rasterization API IXpsRasterizationFactory interface IXpsRasterizationFactory : IUnknown { [helpstring("Create a new instance of IXpsRasterizer.")] HRESULT CreateRasterizer( [in] IXpsOMPage *xpsPage, [in] FLOAT DPI, [in] XPSRAS_RENDERING_MODE nonTextRenderingMode, [in] XPSRAS_RENDERING_MODE textRenderingMode, [out] IXpsRasterizer **ppIXPSRasterizer ); }

XPS Rasterization API IXpsRasterizer interface IXpsRasterizer : IUnknown { [helpstring("Rasterize axis aligned rectangle to a WIC bitmap.")] HRESULT RasterizeRect( [in] INT x, [in] INT y, [in] INT width, [in] INT height, [in] IXpsRasterizerNotificationCallback *notificationCallback, [out]IWICBitmap **bitmap ); }

XPS Rasterization API IXpsRasterizerNotificationCallback interface IXpsRasterizerNotificationCallback : IUnknown { [helpstring("Client callback function called during rasterization to allow client to cancel.")] HRESULT Continue(); }

Summary XPS Rasterization Service is Windows 7 in-box component. The access to the XPS Rasterization Service is through Filter Pipeline Property bag therefore it is for filters from XPSDrv Filter Pipeline only. XPS Rasterization object is bound to an XPS Fixed Page and once it is created, the page must not be modified. Any content that intersects with an axis-aligned rectangle is rasterized to a 32bpp WIC bitmap. The service is optimized for banding. The rasterization object caches some of the resources for the next call. There is an optional Cancel interface for aborting the rasterization process.

Call To Action Look for the XPS Rasterization Filter sample in Windows 7 WDK A sample XPSDrv filter Conversion to XPSOM model Rasterizing the whole page as series of bands Read the white paper on WHDC XPSDrv Filter Pipeline http://www.microsoft.com/whdc/device/print/XPSDrv_FilterPipe.mspx

WHDC PowerPoint Template Notes & Handouts Additional Resources Technical advice XPSinfo@microsoft.com XPS Portal on Microsoft Web site: http://www.microsoft.com/xps Links to relevant blogs, white papers, specifications XPS and Printing on the WHDC Web site: Printing—Architecture and Driver Support http://www.microsoft.com/whdc/device/print/default.mspx Printing documentation on MSDN XPS Printer Drivers in the WDK http://msdn.microsoft.com/en-us/library/aa907458.aspx

Q&A