Core Printer Driver Improvements
Goals Understand what’s new in Unidrv and PScript5, the Windows codenamed "Longhorn" core drivers Understand how to take advantage of the new enhancements in the core drivers Understand how the core drivers and plug-ins interact with existing Windows operating systems
Outline Longhorn core printer driver themes Overview of new features Feature details Additional notes for Longhorn printer driver developers
Longhorn Core Printer Driver Themes Provide an improved user experience Consistent end user experiences for inbox and outbox drivers Improved feature set and reliability Provide new innovation opportunities Feature parity between existing monolithic solutions and inbox drivers Improved fidelity, smaller PDL output Competitive performance for inbox solutions
Overview: Planned Rendering Features Applications Provided by: Microsoft GDI ISV Print Spooler IHV Rendering Plug-in(s) Pre-analysis Unidrv GPD Parser Optimized PDL Output Print Hardware Devices
Overview: Planned Configuration Features Applications Full UI Replacement Provided by: PrintTicket & PrintCapabilities Support Microsoft GDI ISV Print Spooler IHV Configuration Plug-in(s) New Core Helper Interface Unidrv UI / PScript5 UI GDL Parser GDL- based Config AsyncNotify Auto-Config GPD/PPD Parser Print Hardware Devices
Core Printer Driver Improvements Details
GDL – Generic Description Language Allows Unidrv to provide parsed GPD config file to plug-ins (not available in PScript5) Converts input into XML data that can be easily consumed Supports a generic user defined data Allows you to add additional data Visible only through GDL parser
GDL – Generic Description Language UnidrvUI OEM Configuration Plug-in BiDi Support GPD Parser GDL Parser Data inside GDL statements will not be used by Unidrv Output from GPD parser was not designed to be published to plug-ins GPD Parser sees… *PrinterName: “ThatPrinter” *BiDiStuff: ... ... *Ifdef: GDL *% My other structured *% data & templates *Endif
GDL – Generic Description Language UnidrvUI OEM Configuration Plug-in BiDi Support GPD Parser GDL Parser Allows IHVs to access information from the GPD Allows you to provide arbitrary data in the config file(s) that your plug-ins can consume Provides BiDi support GDL Parser sees… *PrinterName: “ThatPrinter” *BiDiStuff: ... ... *Ifdef: GDL *% My other structured *% data & templates *Endif
GDL Output GDL Parser *GPDFileName: Sample.gpd *Feature: RESDLL { *ConcealFromUI: TRUE *Option: UniresDLL *Name: unires.dll } ... GDL Parser <?xml version="1.0" encoding="UTF-8"?> <SnapshotRoot ...> <GDL_ATTRIBUTE Name="*GPDFileName" xsi:type="GDLW_string">Sample.GPD</GDL_ATTRIBUTE> <CONSTRUCT Name="*Feature" Instance="RESDLL"> <GDL_ATTRIBUTE Name="*ConcealFromUI?“ xsi:type="GDLW_XML_BOOLEAN">TRUE</GDL_ATTRIBUTE> <CONSTRUCT Name="*Option" Instance="UniresDLL" Constrained="FALSE"> <GDL_ATTRIBUTE Name="*Name" xsi:type="GDLW_string" >unires.dll</GDL_ATTRIBUTE> </CONSTRUCT> ... </SnapshotRoot>
GDL Templates Templates: Enable you to add custom data to the config file Define how that data is formatted and presented to your plug-in A standard template is provided for all config content that the core drivers understand Your additional templates can appear inline in your GPD file inside an *Ifdef GDL
GDL: Sample Template *Template: GPD_NORMAL_STRING *% ANSI string { *Type: DATATYPE *DataType: FILTER_TYPE *ElementType: XSD_STRING *FilterTypeName: "NORMAL_STRING" } *Template: V_QUERYSTRING *Type: ATTRIBUTE *ValueType: GPD_NORMAL_STRING *Virtual: TRUE
GDL: Sample Template (con’t) *Template: QUERYSTRING { *Name: "*QueryString" *Inherits: V_QUERYSTRING } *Template: BIDIQUERY *Name: "*BidiQuery" *Instances: <ANY> *Type: CONSTRUCT *Members: (QUERYSTRING) *Production: SATISFY_ALL *Member: QUERYSTRING {*Occurs: 1 }
Auto-config Enables support for automatic detection of installable options Requires no plug-in code. GDL changes only. Supported by tcpmon Unidrv: Auto-config information is embedded in GPD / GDL file PScript5: You can include an additional GDL file specifically for BiDi. You will not be able to access this file from your plug-in.
Auto-config: Example *Feature: DuplexUnit { *BidiQuery: DuplexInstalled *QueryString: "\Printer.Configuration.DuplexUnit:Installed" } *BidiResponse: DuplexInstalled *ResponseType: BIDI_BOOL *ResponseData: ENUM_OPTION (DuplexUnit) *Option: NotInstalled *BidiValue: BOOL(FALSE) *Option: Installed *BidiValue: BOOL(TRUE)
New Core Helper Interface Models the existing PScript5 IPrintCoreUI2 interface In addition, the interface: Is available in both Unidrv & PScript5 Doesn’t use multi strings Was designed to maximize performance & ease of use
New Core Helper Interface DECLARE_INTERFACE_(IPrintCoreHelper, IUnknown) { STDMETHOD(GetOption) (…); STDMETHOD(SetOptions) (…); STDMETHOD(EnumConstrainedOptions) (…); STDMETHOD(WhyConstrained) (…); STDMETHOD(EnumFeatures) (…); STDMETHOD(EnumOptions) (…); STDMETHOD(GetFontSubstitution) (…); STDMETHOD(SetFontSubstitution) (…); STDMETHOD(CreateInstanceOfMSXMLObject) (..); }
New Core Helper Interface IPrintCoreHelper IPrintCoreHelperPS IPrintCoreHelperUni Unidrv STDMETHOD(CreateGDLSnapshot) (…); STDMETHOD(CreateDefaultGDLSnapshot) (…); PScript5 STDMETHOD(GetGlobalAttribute) (…) STDMETHOD(GetFeatureAttribute) (…); STDMETHOD(GetOptionAttribute) (…);
New Core Helper Interface Support for Private Features Unidrv Metafile Spooling Pages per sheet (N-Up) Page order Text as graphics PScript5 PScript custom page size Metafile spooling Mirroring Output format & protocol Pages per sheet & page order … and much more The Goal: Allow plug-ins to configure any settings that the core driver allows a user to set.
UI Replacement (The Easy Part) HRESULT __stdcall OEMUI::HideStandardUI( DWORD dwMode ) { switch( dwMode ) case OEMCUIP_DOCPROP: case OEMCUIP_PRNPROP: return S_OK; } return E_NOTIMPL;
UI Replacement (The Harder Part) Write your UI Use GDL Use the new helper interface If you are trying to get your driver in-box, follow in-box UI guidelines. Key points to be aware of: Minimal branding Minimal graphics –16-bit is preferred Standard Windows design guidelines
Planned Rendering Performance Enhancements Far East TrueType font support for Unidrv PCL-XL enhancements Monochrome text z-order fixes Blank band optimizations New DDI hooks Intra-page color/black band switching JPEG escape support Opt-in rendering enhancements for Unidrv
Pre-analysis Provides the driver access to primitives in a pre-rendering pass Force banding: first band is the full page with no band clipping No rendering during pre-analysis pass Enabled by GPD flag Pre-analysis Unidrv samples will be available in Longhorn builds
Pre-analysis for Unidrv Raster Driver (no OEM preanalysis) OEMStartPage OEMStartBanding OEMTextOut( “Windows”) OEMNextBand OEMTextOut(“Rocks!”) OEMStartPa ge OEMStartBanding OEMTextOut( “Windows”) OEMNextBand OEMTextOut(“Rocks!”) OEMStartPage OEMStartBanding OEMTextOut( “Windows”) OEMNextBand OEMTextOut(“Rocks!”) My page Windows Rocks!
Pre-analysis for Unidrv Raster Driver (OEM preanalysis) OEMStartPage OEMStartBanding OEMTextOut( “Windows”) OEMTextOut(“Rocks”) OEMNextBand(pptl=null) OEMNextBand OEMTextOut(“Rocks!”) OEMStartPage OEMStartBanding OEMTextOut( “Windows”) OEMTextOut(“Rocks”) OEMNextBand(pptl=null) OEMNextBand OEMTextOut(“Rocks!”) OEMStartPage OEMStartBanding OEMTextOut( “Windows”) OEMTextOut(“Rocks”) OEMNextBand(pptl=null) OEMNextBand OEMTextOut(“Rocks!”) OEMStartPage OEMStartBanding OEMTextOut( “Windows”) OEMTextOut(“Rocks”) OEMNextBand(pptl=null) OEMNextBand OEMTextOut(“Rocks!”) My page Windows Rocks!
PrintTicket & PrintCapabilities Open-ended configuration infrastructure Applications can read arbitrary print job settings, not just limited fields available in public DEVMODE Providing a better app experience requires help from the drivers Unidrv and PScript5 both provide extended PrintTicket & PrintCapabilities support
Controlling PrintTicket & PrintCapabilities From plug-in code: Implement IPrintOemPrintTicketProvider Control or change how GPD/PPD-based features appear in PrintTicket & PrintCapabilities Edit XML results directly Support settings & capabilities of private DEVMODE From the GPD/PPD file: Override the namespace the core driver generates for your driver Map features in the GPD/PPD file to specific public print schema features
Down-level Operation and Dependencies Planned technologies exposed through core drivers GDL (Windows 2000 & newer) PrintTicket & PrintCapabilities (Windows XP with Windows FX, Longhorn) Full UI replacement (Windows 2000 & newer) Pre-analysis (Windows XP SP1 & newer) Technologies dependent on non-driver components will not be available to drivers running down-level Async UI/Async Notification Bidi API (on Windows 2000) Custom print processors (Point & Print)
Down-level Operation and Dependencies New drivers that use these technologies need to be platform aware Operate gracefully on platforms where technology is not available Controlled functional degradation is acceptable; down-level instability is not In-box drivers must run with the same binaries on Windows 2000, Windows XP, Windows Server 2003, and Longhorn
No Kernel Mode Print Drivers In Windows Server 2003, installation of kernel mode print drivers is blocked by default Policy-based In Longhorn, kernel mode printer drivers will not run The infrastructure to support them will not be present There will be no way to enable kernel mode drivers Core drivers provide a quick way to migrate away from kernel mode drivers and provide maximum functionality for minimal cost
Call to Action Explore Longhorn Print Architecture Identify strategic devices to target the Metro Print Path Identify extension scenarios Convert GDI/DDI based drivers to MetroDrv drivers Explore the sample filters in Longhorn Beta 1 WDK Consider on-device rendering with a RIP implementation A reference implementation is planned for Longhorn Beta 1 tools Alternatively, move monolithic drivers to the core driver architecture This provides the most stable and secure GDI/DDI-based driver environment for customers Take advantage of the new features in the core drivers Start building on Longhorn Beta
Additional Resources Community Sites Web resources http://www.microsoft.com/communities/default.mspx MSDN Developer Community Chats: Printer Drivers -- Ask the Experts Online http://msdn.microsoft.com/chats/windows/windows_102402.asp Windows Drivers: Printer Drivers http://msdn.microsoft.com/chats/windows/windows_101602.asp Windows Drivers Printing and Networking http://msdn.microsoft.com/chats/windows/windows_022002.asp Web resources WS-Devices Profile: http://msdn.microsoft.com/webservices/understanding/specs/ default.aspx?pull=/library/en-us/dnglobspec/html/devprof.asp Printer Working Group http://www.pwg.org WHDC Printing home page: http://www.microsoft.com/whdc/device/print/default.mspx WHDC Still Imaging / WIA home page: http://www.microsoft.com/whdc/device/stillimage/default.mspx
Additional Resources E-mail For developer print questions: prninfo @ microsoft.com For developer scan questions: wiainfo @ microsoft.com For developer color questions: mscolor @ microsoft.com
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.