1 / 31

PrintTicket and PrintCapabilities: Overview of Communications Schema and API

PrintTicket and PrintCapabilities: Overview of Communications Schema and API. Outline. Print Schema, PrintTicket and PrintCapabilities Overview PrintTicket/PrintCapabilities Implementation Details Application Support Driver Requirements and Services Call to Action. Goals.

brede
Download Presentation

PrintTicket and PrintCapabilities: Overview of Communications Schema and API

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PrintTicket and PrintCapabilities:Overview of Communications Schemaand API

  2. Outline • Print Schema, PrintTicket and PrintCapabilities Overview • PrintTicket/PrintCapabilities Implementation Details • Application Support • Driver Requirements and Services • Call to Action

  3. Goals • Define benefits for adoption of Print Schema • Define the PrintSchema and PrintTicket/PrintCapabilities • Understand interaction of technologies • Understand information flow • Communicate the requirements to implement PT/PC in a driver • Changes to existing drivers • System services to assist PT/PC support

  4. Print Settings and Capabilities Today • Limited App to Driver Communication • Device capabilities – Win32 DeviceCapabilities() API • Binary, non-extensible • Job formatting settings - DEVMODE • Binary, opaque, inconsistent, non-portable • No handling of user intent • No consistency between capability and formatting representation • Pain Points • Application and driver UI and settings mismatch • Application are unable to determine full capabilities of drivers

  5. Planned Windows Longhorn Print Settings and Capabilities • Print Schema • XML Schema for print settings and capabilities • Print Schema Framework • Enables rich expression of print capabilities • Enables intelligent validation of print settings and user intent • Print Schema Keywords • Publicly defined keywords to represent device capabilities and settings • Supports private extensions

  6. Planned Windows Longhorn Print Settings and Capabilities • Print Schema Keyword Scoping • Keywords are “scoped” to levels in a hierarchy • Job > Document > Page • Keywords can be inherited from higher levels • E.g. DocumentDuplex settings can be inherited from the Job level to the Document level • Keywords can be overridden from lower levels • E.g. PageMediaSize settings from a Page level will override a PageMediaSize setting from a Job or Document level

  7. Windows Longhorn Print Settings and Capabilities • PrintTicket and PrintCapabilities (PT/PC) • Implement the Print Schema on the Windows platform • PrintTicket • Specify and persist print job formatting information • Function parallels current binary DEVMODE structure • PrintCapabilities • Publish configurable device attributes • Function parallels current Win32 DeviceCapabilities API

  8. Print Driver Support for PT/PC • Print Driver Provider interface • Enables drivers to support PT/PC functionality • Plug-in interface for Unidrv and PScript5 drivers • Enables plug-ins to extend core driver PT/PC functionality • GPD/PPD to Print Schema Custom Mapping • Enables translation of GPD/PPD specified keywords to Print Schema equivalents • Support for all Version 3 print drivers - including MetroDrv drivers

  9. Application Support for PT/PC • Win32 API • Enables Win32 applications to • Query PrintCapabilities • Merge and validate PrintTickets • Convert between PrintTickets and DEVMODEs • WinFX API • API supports Win32 functionality for WinFX applications • Additional convenience objects partially wrap XML data to simplify application access • Advanced features and private keywords require XML manipulation • Win32 and WinFX APIs make it easy for applications to adopt PT/PC

  10. Metro Supportfor PT/PC • PrintTickets define print settings for Metro Reach Packages • Metro leverages the “scoping prefix” support of PT • PrintTicket “scoping” levels map directly to the Metro content hierarchy • Job → FixedDocumentSequence • Document → FixedDocument • Page → FixedPage • Attend “Details on the Longhorn Spool File Format” presentation for more information on Metro

  11. PT/PC XML Sample PrintCapabilities XML <f:PrintCapabilities xmlns:f="http://.../printschemaframework" xmlns:k="http://.../printschemakeywords"> <f:Feature name=“k:JobStaple”> <f:Option name=“k:None”/> <f:Option name=“k:StapleTopLeft”> <f:ScoredProperty name=“k:StapleAngle”> <psf:Value xsi:type="xs:integer">45</psf:Value> </f:ScoredProperty> … </f:Feature> </f:PrintCapabilities> PrintTicket XML <f:PrintTicket xmlns:f="http://.../printschemaframework" xmlns:k="http://.../printschemakeywords"> <f:Feature name=“k:JobStaple”> <f:Option name=“k:None”/> </f:Feature> </f:PrintTicket>

  12. PT/PC Metro Sample Relationship Hierarchy Metro Package FixedDocument Sequence Job PT FixedDocument 1 FixedDocument N … Doc PT 1 Doc PT N … … FixedPage N/1 FixedPage 1/1 Page PT 1/1 Page PT N/1

  13. PT/PC Metro Sample <f:PrintTicket ... > <f:Feature name=“k:PageMediaSize”> <f:Option name=“k:NALetter”/> </f:Feature> <f:Feature name=“k:PageOutputQuality”> <f:Option name=“k:High”/> </f:Feature> <f:Feature name=“k:PageOrientation”> <f:Option name=“k:Portrait”/> </f:Feature> </f:PrintTicket> Job PrintTicket + <f:PrintTicket ... > <f:Feature name=“k:PageOutputQuality”> <f:Option name=“k:Normal”/> </f:Feature> </f:PrintTicket> Document PrintTicket + <f:PrintTicket ... > <f:Feature name=“k:PageOrientation”> <f:Option name=“k:Landscape”/> </f:Feature> </f:PrintTicket> Page PrintTicket = <f:PrintTicket ... > <f:Feature name=“k:PageMediaSize”> <f:Option name=“k:NALetter”/> </f:Feature> <f:Feature name=“k:PageOutputQuality”> <f:Option name=“k:Normal”/> </f:Feature> <f:Feature name=“k:PageOrientation”> <f:Option name=“k:Landscape”/> </f:Feature> </f:PrintTicket> Merged PrintTicket for Page

  14. PT/PC Distribution Plans • PT/PC driver support will be available on Windows XP forward • PT/PC WinFX API will only be available with WinFX • PT/PC Win32 API planned to ship with Windows Longhorn and PT/PC drivers • OS support being explored for Windows XP and later

  15. PrintTicket and PrintCapabilities: Implementation Details

  16. PrintTicket/PrintCapabilities End-to-End Managed Code WinFX App Win32 App Microsoft ISV Application IHV WinFX PT/PC API Win32 PT/PC API Platform PT/PC System Layer Driver GPD/PPD Legacy IHV Plugin (non-provider) Longhorn Unidrv/PScript5 (PT/PC provider) Longhorn IHV Print Driver (PT/PC provider) Legacy IHV Print Driver (non-provider) Longhorn IHV Plugin (PT/PC provider)

  17. WinFX PT/PC API: PrintQueue • Assembly • System.Printing.dll • Namespace • System.Printing.PrintSubSystem • Class • PrintQueue • APIs • public PrintCapabilities GetPrintCapabilities( PrintTicket printTicket) • public MemoryStream GetPrintCapabilitiesAsXml(PrintTicket printTicket) • public ValidationResult MergeAndValidatePrintTicket( PrintTicket basePrintTicket, PrintTicket deltaPrintTicket) • public static intMaxPrintSchemaVersion {get} • public PrintTicketUserPrintTicket{get; set} • Public PrintTicketDefaultPrintTicket {get; set}

  18. WinFX PT/PC API: PrintTicketConverter • Assembly • ReachFramework.dll • Namespace • System.Printing.Interop • Class • PrintTicketConverter • APIs • public PrintTicket ConvertDevModeToPrintTicket(byte[] devMode) • public byte[] ConvertPrintTicketToDevMode( PrintTicket printTicket, BaseDevModeType baseType) • public static intMaxPrintSchemaVersion {get}

  19. WinFX PT/PC API: Convenience Objects • Assembly • ReachFramework.dll • Namespace • System.Printing.Configuration • Class • PrintTicket, PrintCapabilities • API samples pt.PageOrientation.Value = PrintSchema.OrientationValue.Portrait; pt.PageMediaSize.SetCustomMediaSize(width, height); pt.PageCopyCount.Value = 10; if (pc.SupportsCapability(PrintSchema.Feature.DocumentDuplex)) { ... } foreach (FixedMediaSizeOption media in pc.PageMediaSizeCapability.FixedMediaSizes) { ... } • Provides object based access to PT/PC content so clients do not have to manipulate raw XML for common features • For advanced or private Print Schema features clients need to access raw XML

  20. WinFX PT/PC API: Metro Support • Assembly • PresentationFramework.dll • Namespace • System.Windows.Documents • Class • FixedDocumentSequence, FixedDocument, FixedPage • APIs • public object PrintTicket {get; set} • Sample PrintQueue printQueue = new PrintQueue(...); PrintTicket pt = printQueue.UserPrintTicket.Clone(); pt.PageOrientation.Value = PrintSchema.OrientationValue.Landscape; FixedDocument fixDoc = new FixedDocument(); fixDoc.PrintTicket = pt;

  21. Win32 PT/PC API • SDK Header • sdk\inc\prntvpt.h • SDK Lib • sdk\lib\i386|ia64|amd64\prntvpt.lib • APIs • HRESULT WINAPI PTQuerySchemaVersionSupport(...) • HRESULT WINAPI PTOpenProvider(...) • HRESULT WINAPI PTOpenProviderEx(...) • HRESULT WINAPI PTGetPrintCapabilities(...) • HRESULT WINAPI PTMergeAndValidatePrintTicket(...) • HRESULT WINAPI PTConvertPrintTicketToDevMode(...) • HRESULT WINAPI PTConvertDevModeToPrintTicket(...) • HRESULT WINAPI PTCloseProvider(...) • No Win32 equivalent of WinFX PT/PC convenience objects

  22. PrintTicket/PrintCapabilities End-to-End Managed Code WinFX App Win32 App Microsoft ISV Application IHV WinFX PT/PC API Win32 PT/PC API Platform PT/PC System Layer Driver GPD/PPD Legacy IHV Plugin (non-provider) Longhorn Unidrv/PScript5 (PT/PC provider) Longhorn IHV Print Driver (PT/PC provider) Legacy IHV Print Driver (non-provider) Longhorn IHV Plugin (PT/PC provider)

  23. PT/PC System Layer • Unmanaged, common system layer for both WinFX and Win32 APIs • Enable a single, consistent set of PT/PC APIs regardless of the underlying driver’s support • For printer driver with PT/PC provider support • PT/PC system layer routes client’s PT/PC request to the printer driver, and returns driver’s PT/PC service result to the client • For legacy driver without PT/PC provider support • PT/PC system layer performs PT/PC service on behalf of the legacy driver, with Win32 API limitations

  24. Support PT/PC in IHV Printer Driver • Implement IPrintTicketProvider interface to become a PT/PC provider: (defined in oak\inc\prdrvcom.h) DECLARE_INTERFACE_(IPrintTicketProvider, IUnknown) { // IUnknown methods skipped STDMETHOD(GetSupportedVersions)(...) STDMETHOD(BindPrinter)(...) STDMETHOD(ConvertPrintTicketToDevMode)(...) STDMETHOD(ConvertDevModeToPrintTicket)(...) STDMETHOD(GetPrintCapabilities)(...) STDMETHOD(ValidatePrintTicket)(...) }

  25. Longhorn MS Core Driver PT/PC Support • Longhorn Unidrv/PScript5 core drivers are PT/PC providers • Core drivers perform PT/PC operations based on GPD/PPD • Printer’s capabilities, feature set and constraints • Core drivers map between standard GPD/PPD features/options and public Print Schema features/options. Examples: • GPD: PaperSize, PPD: PageSize  PrintSchema: PageMediaSize • GPD: Duplex, PPD: Duplex  PrintSchema: JobDuplex

  26. GPD/PPD  PrintSchema Custom Mapping • Core driver automatically converts non-standard GPD/PPD features/options • Features/options scoped in a printer-model-name based private namespace URI • IHV has the option to specify custom mapping using new GPD/PPD keywords • Custom mapping allows IHV to specify: • public Print Schema keyword a GPD/PPD feature/option should be mapped to • a private namespace URI that replaces the default printer-model-name based private namespace URI • Provides flexibility for specification of non-standard feature/options • Map “foo” to a standard Print Schema feature or • Specify a private namespace URI for “foo”

  27. Custom Mapping GPD/PPD Samples GPD *PrintSchemaPrivateNamespaceURI:“http://www.ihv.com/schema/2004” *Feature: IHVStapling { *PrintSchemaKeywordMap: “JobStaple" *Option: Enabled { *PrintSchemaKeywordMap: “StapleTopLeft" } *Option: Disabled { *PrintSchemaKeywordMap: “None“ } } PPD *MSPrintSchemaPrivateNamespaceURI: “http://www.ihv.com/schema/2004” *OpenUI *IHVStapling: PickOne *DefaultIHVStapling: Disabled *IHVStapling Enabled: “...” *IHVStapling Disabled: “...” *CloseUI: *IHVStapling *MSPrintSchemaKeywordMap: JobStaple *IHVStapling *MSPrintSchemaKeywordMap: JobStaple StapleTopLeft *IHVStapling Enabled *MSPrintSchemaKeywordMap: JobStaple None *IHVStapling Disabled

  28. Support PT/PC in IHV Plugin • When to add PT/PC support in IHV plugin? • If you have capabilities, features or constraints that are not expressible in GPD/PPD • If you have plugin private DEVMODE settings • In general, if you want to customize core driver’s PT/PC provider behavior • How to add PT/PC support in IHV plugin? • Implement IPrintOemPrintTicketProvider interface (defined in oak\inc\prcomoem.h) DECLARE_INTERFACE_(IPrintOemPrintTicketProvider, IUnknown) { // IUnknown methods skipped STDMETHOD(GetSupportedVersions)(...) STDMETHOD(BindPrinter)(...) STDMETHOD(PublishPrintTicketHelperInterface)(...) STDMETHOD(QueryDeviceDefaultNamespace)(...) STDMETHOD(ConvertPrintTicketToDevMode)(...) STDMETHOD(ConvertDevModeToPrintTicket)(...) STDMETHOD(CompletePrintCapabilities)(...) STDMETHOD(ExpandIntentOptions)(...) STDMETHOD(ValidatePrintTicket)(...) };

  29. Call To Action • Understand Longhorn Print Architecture • Identify strategic devices to target the Metro Print Path • Identify extension scenarios • Understand the Windows Color System • Review the Metro v.7 specification • http://www.microsoft.com/whdc/device/print/metro.mspx • Start implementation with Beta 1! • 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

  30. 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 • Developer kit references: • SDK for Print Schema User Manual and Keywords: http://winfx.msdn.microsoft.com/library/en-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 PrintTicket Providers and Consumers • WinFX Print System Object • Documentation available in WinFX Beta 1 SDK

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

More Related