2-94 Developing apps and devices that print in Windows 10 and Windows 10 Mobile Justin Hutchings Senior Program Manager Operating Systems Group.

Slides:



Advertisements
Similar presentations
Ondrej Stastny Microsoft Premier Field Engineer Windows 8.1 Äpipäev.
Advertisements

Java2 Printing API Jean-Cédric Desrochers March 9, 2000.
1.Why incorporate scanning in your app? 2.Your app + scanner device compatibility 3.Simplicity of the new Scanner namespace 4.Demo: scanning from an.
Advanced Workgroup System. Printer Admin Utility Monitors printers over IP networks Views Sharp and non-Sharp SNMP Devices Provided Standard with Sharp.
Chapter 11 Chapter 11: Installing and Managing Printers.
Chapter 10 Chapter 10: Printer Management. Chapter 10 Learning Objectives n Describe the printing process used by Windows NT n Install a local printer.
By Rashid Khan Lesson 7-Preparing for Output: Printer Configuration and Management.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 12: Network Printing and Offline Files.
MZ790 Print Driver and RINC Software Install and Setup These instructions are to assist you in installation and setup of the MZ790 Print Driver and RINC.
1 Chapter Overview Introduction to Windows XP Professional Printing Setting Up Network Printers Connecting to Network Printers Configuring Network Printers.
Filter-based Print Drivers: Overview. Outline MetroDrv Architecture and Data Flow Filter Pipeline Implementation MetroDrv Filter Development Discussion.
SP2 Mikael Nystrom. Agenda Översikt Installation.
Printing Terminology. Requirements for Network Printing At least one computer to operate as the print server Sufficient RAM to process documents Sufficient.
CN1260 Client Operating System Kemtis Kunanuraksapong MSIS with Distinction MCT, MCITP, MCTS, MCDST, MCP, A+
Windows Server 2008 Chapter 6 Last Update
Chapter 13: Sharing Printers on Windows Server 2008 R2 Networks BAI617.
1 Windows Printing. 2 Objectives You will be able to Output text and graphics to a printer. Print multipage documents. Use the standard Windows print.
Managing Local and Network Printer Chapter 11 powered by dj.
Sharing Geographic Content
How to Download and Install a Sharp Print Driver on a Mac.
Module 14: Configuring Print Resources and Printing Pools.
Chapter 6 Configuring Windows Server 2008 Printing
STIP Chapter#10 Mastering Windows Forms Created By, Vishwesh Patel.
Oki Printing Solutions Product Training for the MC860/CX2633 MFP.
Click your mouse to continue. Ways to Merge Data When you have finished editing your main document and inserting the merge fields, you have several choices.
Enabling High-Quality Printing in Web Applications
Web hosting in app Creating a Windows Store app with web assets.
The Windows Runtime (WinRT) is the shared runtime and API space used by store apps across the Windows platform (phone and client) 5 Common WinRT.
Chapter 9 Network Printer Terminology Setting Up A Network Printer Adding A Workstation Printer to Network.
Windows Programming Using C# Printing, Documentation, & Deployment.
11 WORKING WITH PRINTERS Chapter 10. Chapter 10: WORKING WITH PRINTERS2 TERMINOLOGY PrinterLogical object Print DevicePhysical object Printer DriversSoftware.
Configuring Data Protection Chapter 12 powered by dj.
Build advanced touch apps in Windows 8
11 CONFIGURING AND MANAGING PRINTERS AND FAX DEVICES Chapter 6.
11 WORKING WITH PRINTERS Chapter 10. Chapter 10: WORKING WITH PRINTERS2 THE WINDOWS SERVER 2003 PRINTER MODEL  Locally attached printers Printers that.
Page 1 Printing & Terminal Services Lecture 8 Hassan Shuja 11/16/2004.
Computer Information Technology – Section 5-4.  Objectives:  The students will 1. Understand the options on the Printer's Document Properties dialog.
Ⅰ. PS Driver ML-4050N Series PostScript, Driver ML-4050N Series PostScript, Driver.
1 Printing a Document. 2 Objectives You will be able to print a real multipage document.
1 Overview of Microsoft Windows 2000 Multipurpose OS Reduces total cost of ownership (TCO)
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring Windows Server 2008 Printing.
WorkCentre ® 5020 A3 Black and White Multifunction System Essential features, bottom line savings.
Hands-On Microsoft Windows Server 2008 Chapter 6 Configuring Windows Server 2008 Printing.
Printing. Printing Terminology Logical Printer Physical Printer/Print Device Print Server Locally vs network attached printer Non-remote vs remote printer.
PowerPoint PowerPoint is a presentation software package. With PowerPoint, you can easily create slide shows. Trainers and other presenters use slide shows.
Printer Management Chapter 5 - Objectives.
Managing Windows Devices
SMALL HOME NETWORK Local Network Area.
PowerPoint: Print views and printing
Contact 4 Instant support EPSON PRINTER Technical Support Number
PowerPoint: Print views and printing
Building a great Metro style device app for your printer
Introduction to Computers
Printers.
Samsung Printer Customer Service can resolve all issues related to :  Connectivity Errors  Network Issues  Driver Not Found  Not Printing Black 
Canon Printer Support Number
Integrating with the Windows Device Experience
About AirPrint AirPrint is an Apple technology that helps you create full-quality printed output without the need to download or install drivers.
Made by Aistė Augustinaitė Software Engineering 3 group
Windows SDK for Facebook
The lifetime of XAML text: from input to display through printing
What’s new for Silverlight & XNA developers in Windows Phone Mango
Open Automation Software
Your Desktop Personal Assistant
Epson Error Code 0x98 Fix for Epson Error Code 0x98 in USA | Epson support 247.
05 | Advanced Contracts Pt 1
Presentation transcript:

2-94 Developing apps and devices that print in Windows 10 and Windows 10 Mobile Justin Hutchings Senior Program Manager Operating Systems Group

Agenda Windows print architecture in Windows 10 Developing apps that print Developing printers that work with Windows 10 Mobile

Windows print architecture XPS Print Document Package Target API Windows print architecture Direct2D Windows Style App Print API App rendering API HTML5 XAML Print Manager Print Dialog Windows Runtime Windows Print Spooler (Desktop) Windows Print Spooler (Desktop) Windows Print Job Manager (Mobile) Printer Drivers Printer Drivers

Windows 10 vs Windows 10 Mobile Supported connection types Setup Supported printers Apps Windows 10 USB, Network, Shared, “Virtual” Installed ahead of time Any printer which has a printer driver available Windows Apps Windows 8 Apps Win32 etc. Windows 10 Mobile Network Installed on demand Supported printers work automatically Unsupported printers not shown Only Windows 10 Mobile compatible printers Must support WS-Print protocol Must support a standard PDL

Windows 10 Mobile supported printers More than 1900 printers supported Many popular brands supported Details will be available closer to Windows 10 general availability More printers will be available in fall ‘15 Built-in support for saving as PDF

Demo

Developing apps that print

Build once and run everywhere Windows Apps Build once and run everywhere Printing supported on Windows 10 and Windows 10 Mobile Printing is not currently supported on Xbox Printing not available in legacy Windows Phone apps

Changes from Windows 8.1 to Windows 10 Charm-based print entry point removed Mitigation: Your app must include a print button. Print button should only be active/visible if the app is currently able to print. Print API is published for all Windows platforms Mitigation: Your app must fail gracefully if printing is not currently supported. Surround all calls to PrintManager.ShowPrintUIAsync() with a try/catch block.

Sample: What we’ll cover… XPS Print Document Package Target API Sample: What we’ll cover… Direct2D Windows Style App Print API App rendering API HTML5 XAML Print Manager Print Dialog Windows Runtime Windows Print Spooler (Desktop) Windows Print Job Manager (Mobile) Printer Drivers

XAML registration, showing the print dialog Register for PrintTaskRequested Show print button Call ShowPrintUIAsync() Handle PrintTaskRequested and provide PrintTaskSourceRequested Handle PrintTaskSourceRequested by providing an IPrintDocumentSource (property of PrintDocument for XAML apps)

Register for printing void registerForPrinting() { //Register for PrintTaskRequested event PrintManager PrintManager = PrintManager.GetForCurrentView(); PrintManager.PrintTaskRequested += PrintManager_PrintTaskRequested; //Build a PrintDocument and register for callbacks this.Document = new PrintDocument(); this.Document.Paginate += Paginate; this.Document.GetPreviewPage += GetPreviewPage; this.Document.AddPages += AddPages; }

PrintTaskRequested void PrintManager_PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs args) { // Create the PrintTask. // Defines the title and delegate for PrintTaskSourceRequested PrintTask printTask = args.Request.CreatePrintTask("Print Job Title", PrintTaskSourceRequested); // Handle PrintTask.Completed to catch failed print jobs printTask.Completed += PrintTaskCompleted; // Configure app specific features for print dialog configurePrintTaskOptionDetails(printTask); }

Configure custom features void configurePrintTaskOptionDetails(PrintTask printTask) { PrintTaskOptionDetails details = PrintTaskOptionDetails.GetFromPrintTaskOptions(printTask.Options); IList<string> displayedOptions = details.DisplayedOptions; // Create a new list option PrintCustomItemListOptionDetails fit = details.CreateItemListOption("Fit", "Fit to Page"); fit.AddItem("Scale", "Scale to Fit"); fit.AddItem("Crop", "Crop to Fit"); // Add the custom option to the option list, handle changes displayedOptions.Add("Fit"); details.OptionChanged += details_OptionChanged; }

PrintTaskSourceRequested void PrintTaskSourceRequested(PrintTaskSourceRequestedArgs args) { // Set the document source. This should be initialized in // advance due to short timeouts for this event. args.SetSource(this.Document.DocumentSource); }

XAML print preview PrintDocument receives all IDocumentSource, IDocumentPageSource and IPrintPreviewPage calls from PrintManager PrintDocument calls Paginate handler Foreach page returned by Paginate handler, PrintDocument calls GetPreviewPage handler

Paginate void Paginate(object sender, PaginateEventArgs e) { // Fired every time that the PrintTaskOptions change // PaginateEventArgs has a copy of current PrintTaskOptions // Do any necessary work to determine how many // pages are in the printable content // then set the page count. this.Document.SetPreviewPageCount(this.Pages.Count, PreviewPageCountType.Final); }

GetPreviewPage void GetPreviewPage(object sender, GetPreviewPageEventArgs e) { // Provide a UIElement as the print preview. // Keep in mind the 1-based indexing for print page numbers int zeroBasedPageNumber = e.PageNumber - 1; this.Document.SetPreviewPage(e.PageNumber, this.Pages[zeroBasedPageNumber].Image as UIElement); }

XAML page rendering If custom options exist, OptionChanged handler may be invoked Otherwise, when user clicks print, PrintDocument receives the MakeDocument call. PrintDocument then calls AddPages handler. PrintTaskCompleted event fired to indicate success/failure

OptionChanged void details_OptionChanged(PrintTaskOptionDetails sender, PrintTaskOptionChangedEventArgs args) { // Find out what option changed if (args.OptionId != null && args.OptionId.ToString() == "Fit") IPrintOptionDetails fit = sender.Options[args.OptionId.ToString()]; switch (fit.Value.ToString()) // Handle selected option cases here }

AddPages async void AddPages(object sender, AddPagesEventArgs e) { //Loop through pages to print and add to PrintDocument for (int pageNum = 0; pageNum < this.Pages.Count; pageNum++) var pageDesc = e.PrintTaskOptions.GetPageDescription((uint)pageNum); var currentPage = this.Pages[pageNum]; // Render UIElement in target resolution; DIP = 1/96” this.Document.AddPage(await currentPage.GetPageInTargetResolution( (pageDesc.ImageableRect.Width*DpiX)/96), (pageDesc.ImageableRect.Height*DpiY)/96)); } this.Document.AddPagesComplete();

PrintTaskCompleted void PrintTaskCompleted(PrintTask sender, PrintTaskCompletedEventArgs args) { if (args.Completion == PrintTaskCompletion.Failed) // Notify the user in UI Windows.UI.Popups.MessageDialog md = new Windows.UI.Popups.MessageDialog("Printing failed."); md.ShowAsync(); }

App developer call to action Update your Windows 8/8.1 apps to Windows Apps Place your own print button in the UI Catch exceptions around ShowPrintUIAsync() in case your app is running on a platform without printing Test on Windows 10 and on Windows 10 Mobile. Report any problems you find using the MSDN forums or the Windows Feedback app. https://social.msdn.microsoft.com/Forums/windowsapps/en-US/home

Designing printers for Windows 10 and Windows 10 Mobile

Windows 10 support for industry standards Windows 10 Mobile OpenXPS (ECMA-388) ✓ PWG Raster (PWG-5102.4-2012) PCLm (WFA WFDS-Print)

Windows 10 Mobile printer requirements Support at least one communication protocol WS-Print v1.x WS-Print v2.0 Support at least one standard PDL PWG Raster (PWG-5102.4-2012) PCLm (WFA WFDS-Print) OpenXPS (ECMA-388) MS XPS Support discovery New devices: Add “MobilePrinter” to WS-Discovery categories; describe supported PDL in WS-Print Formats element Existing devices: Contact prninfo@microsoft.com for more information

Mobile compatible printers on desktop Mobile compatible printers automatically supported on desktop with class drivers PCLm-only printers still require a 3rd party driver Support for WS-Print 2.0 additionally enables: Custom Features/Options Localized Feature/Option names Custom Bidi status, queries

WS-Print v2.0 Allows printers to expose additional device features without a driver Superset of WS-Print v1.0 plus new operations: PrepareToPrint – Informational operation which allows printers to warm up CreatePrintJob2 – Extension of CreatePrintJob including PrintSchema PrintTicket GetPrintDeviceCapabilities – Allows retrieval of a PrintDeviceCapabilities document GetPrintDeviceResources – Allows retrieval of localized resources in ResX GetBidiSchemaExtensions – Allows retrieval of Bidi Schema extensions

What PDL should I implement? OpenXPS Benefits: Full fidelity vector encoding, smallest spool file size Drawbacks: Parsing can be memory intensive Best for: Enterprise-class devices PWG Raster Benefits: Low processing overhead, page processing intent built into PDL Drawbacks: Large spool file size can cause slow printouts Best for: Inkjets, low cost laser devices PCLm Benefits: Proper subset of PDF using only raster, smaller PDL than PWG Raster Drawbacks: No built-in page processing intent, no MS class driver for Windows 10 Best for: Product lines with PDF processing already available

PrintDeviceCapabilities format New PrintSchema document type used to generate PrintCapabilities and PrintTicket. Includes simple constraints and options for PWG Raster consumers. ... <psk:JobDuplexAllDocumentsContiguously psf2:psftype="Feature"> <psk:OneSided psf2:psftype="Option" psf2:default="true"/> <psk:TwoSidedLongEdge psf2:psftype="Option"/> <psk:TwoSidedShortEdge psf2:psftype="Option"/> </psk:JobDuplexAllDocumentsContiguously> <psf2:InvalidCombination> <psf2:InvalidCombinationEntry psf2:feature="psk:PageMediaType" psf2:option="psk:Transparency"/> <psf2:InvalidCombinationEntry psf2:feature="psk:JobDuplexAllDocumentsContiguously" psf2:option="psk:TwoSidedLongEdge"/> </psf2:InvalidCombination> <psf2:DocumentFormatOptions> <psf2:PwgRasterBacksideTumble psf2:DuplexType="psk:TwoSidedShortEdge"> true </psf2:PwgRasterBacksideTumble> <psf2:PwgRasterBacksideTumble psf2:DuplexType="psk:TwoSidedLongEdge"> false <psf2:DuplexPageOrder>Standard</psf2:DuplexPageOrder> <psf2:PwgRasterDocumentTypesSupported> <psf2:PwgRasterDocumentType psf2:PageOutputColor="psk:Color"> Srgb_8 </psf2:PwgRasterDocumentType>

ResX format <?xml version="1.0" encoding="utf-8"?> <root ResX used to localize custom features and options. Windows 10 will retrieve ResX from WS-Print v2.0 devices. Devices can optionally redirect to a remote URL. <?xml version="1.0" encoding="utf-8"?> <root xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <data name="schemas.contoso.com/2014/printschema/Main"> <value>Main paper tray</value> </data> </root>

Printer IHV Call to Action Add support for Windows 10 Mobile Choose one or more standard PDLs: PWG Raster, PCLm, OpenXPS or MS XPS and build them into your printers Add support for the MobilePrinter category in WS-Discovery Update your WS-Print implementation to describe the PDL(s) that you support Add support for WS-Print v2.0 to enable a richer feature set Test your printers against the new Hardware Lab Kit to ensure compatibility If you have existing printers which support our standards Contact prninfo@microsoft.com for information about including support for these

For More Information Whitepapers and specifications Developing printers that support Windows 10 Mobile Print Schema Specification v2.0 WSD Print Service Specification v2.0 v4 Print Driver Improvements in Windows 10 Device Profile For Web Services Location Extension