1 / 19

Printer Driver Development in Windows 7

Agenda. New API and features in Windows 7Print Driver IsolationXPS Print APIPlugin Execution Context APIPrint filter pipelineUpdatesPerformancePoint'n'print and Client Side Rendering. Print Driver Isolation. A driver can be loaded in the spooler process, orin a shared sandbox, or isolated

niveditha
Download Presentation

Printer Driver Development in Windows 7

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


    2. Printer Driver Development in Windows 7 Felix Maxa Software Engineer Microsoft Corporation

    3. Agenda New API and features in Windows 7 Print Driver Isolation XPS Print API Plugin Execution Context API Print filter pipeline Updates Performance Point’n’print and Client Side Rendering

    4. Print Driver Isolation A driver can be loaded in the spooler process, or in a shared sandbox, or isolated sandbox Driver attributes and group policy A print processor is isolated based on the policy of the driver that is associated with the queue that is printing the job Isolation policies on client and server are unrelated

    5. Print Driver Isolation CSR – Client Side Rendering SSR – Server Side Rendering

    6. XPS Print API Submits XPS documents to XPS and GDI printers Sends document events to driver Parity with WPF and GDI drivers Runs in client application process We’ll have a white paper about it – draft by WinHEC

    7. Print Plug-in Context API

    8. Print Filter Pipeline – Optional Service Providers “FilterServiceProvider” tag introduced in Windows Vista “OptionalFilterServiceProvider” tag introduced in Windows 7

    9. Print Filter Pipeline - Updates Property bag: XPS_FP_OUTPUT_FILE L"PrintOutputFileName" Bypass print filter pipeline Use XPS_PASS data type Windows 7: enabled loading dependent DLLs from drivers directory

    10. Print Filter Pipeline – Restricted Fonts IPartFont interface introduced in Windows Vista IPartFont2 interface introduced in Windows 7

    11. Print Filter Pipeline - Performance Performance issues with various types of documents Thousands of pages 100 MB page or image associated with page Pages with thousands of relationships Fixed bugs in Vista SP1 and more in Windows 7 Fewer disk I/O operations More efficient use of buffers and memory More than 100% performance improvement in certain scenarios

    12. Print Filter Pipeline - Discard Control Microsoft XPS Document Converter (MXDC) produces discard control in Windows 7 Filters should be able to handle IPartDiscardControl The physical location of discard data – close to sentinel page Example of sequence of parts received by a filter when printing an XPS doc with 3 pages:

    13. Print Filter Pipeline - Best Practices Impersonation Pipeline process runs a “local service” Filters must impersonate when accessing user data When using the printer handle PTOpenProviderEx, PTMergeAndValidatePrintTicket, etc.

    14. Print Filter Pipeline - Best Practices Global Variables The same filters can be used in multiple pipelines at the same time Pipeline process can call InitializeFilter and StartOperation concurrently Protect global variables

    15. Print Filter Pipeline – Best Practices Obfuscated Fonts The Vista RTM WDK sample shows an unsupported method for using obfuscated fonts in the pipeline. This is what we recommend: 1) Create the font and use a uniform resource identifier (URI) that includes "/", such as: L"/21223d92-e614-48a5-925c-c6962b6a8124.odtff" (“/” is not needed on SP1 and later)  2) Call the SetFontOptions method on the IPartFont. This method sets the appropriate content type and marks the font as obfuscated : pFont->SetFontOptions(Font_Obfusticate)  3) Do not XOR manually the first bytes of the font data stream with the GUID which is part of the URI.

    16. Client- and Server-Side Rendering Filter pipeline is subject to client-side rendering (CSR) SetPrinterData values "ForceClientSideRendering“ in Windows 7 "EmfDespoolingSetting“ in Vista and later Client – Server connectivity problems Connection is switched to server-side rendering (SSR) in Vista Connections stays CSR in Windows 7

    17. Client-Side Rendering – GUID names CSR uses local printer objects Name like \\CSR|server\{GUID} Possible to retrieve the printer connection name Get the printer handle from the property bag XPS_FP_PRINTER_HANDLE property Key “dsspooler” and the value “UNCName“ in GetPrinterDataEx

    18. Call To Action Review and follow best practices discussed in this deck Continue adoption of new technologies in your driver and device development: XPS, WSD Attend other print-related sessions

    19. Related Sessions

    20. Additional Resources E-mail aliases for developer support: prninfo and xpsinfo Print Devices on the WHDC Web Site: http://www.microsoft.com/whdc/device/print/default.mspx XPS on the Microsoft Web site: http://www.microsoft.com/xps

More Related