You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hub/apps/develop/devices-sensors/print-from-your-app.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,6 @@ For more advanced features, see [Customize the print preview UI](customize-the-p
23
23
24
24
The first step to add printing to your app is to register for printing by getting the [PrintManager](/uwp/api/windows.graphics.printing.printmanager) object for the current window. The PrintManager class is responsible for orchestrating the printing flow for your app. To use this class, you must first call the method that returns the PrintManager object that is specific to the current active window.
25
25
26
-
- In a non-UWP app, use the [PrintManagerInterop.GetForWindow](/windows/win32/api/printmanagerinterop/nf-printmanagerinterop-iprintmanagerinterop-getforwindow) method.
27
-
- In a UWP app, use the [PrintManager.GetForCurrentView](/uwp/api/windows.graphics.printing.printmanager.getforcurrentview) method.
28
-
29
26
Your app must do this on every screen from which you want your user to be able to print. Only the screen that is displayed to the user can be registered for printing. If one screen of your app has registered for printing, it must unregister for printing when it exits. If it is replaced by another screen, the next screen must register for printing when it opens.
> In UWP printing examples, it's recommended to register for printing from the OnNavigatedTo method override. In non-UWP apps, you need to use the window handle in the PrintManagerInterop.GetForWindow call, so you should use the Loaded event to ensure that the window handle is not `null`, which might be the case in OnNavigatedTo.
65
+
> In UWP printing examples, it's recommended to register for printing from the OnNavigatedTo method override. You need to use the window handle in the PrintManagerInterop.GetForWindow call, so you should use the Loaded event to ensure that the window handle is not `null`, which might be the case in OnNavigatedTo.
69
66
70
67
Here, the event handlers are unregistered in the `UnregisterForPrinting` method, which is called from the [OnNavigatedFrom](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.page.onnavigatedfrom) method.
71
68
@@ -110,9 +107,6 @@ Add a print button to your app's screen where you'd like it to appear. Make sure
110
107
111
108
In the Button's Click event handler, show the Windows print UI to the user.
112
109
113
-
- In a non-UWP app, use the [PrintManagerInterop.ShowPrintUIForWindowAsync](/windows/win32/api/printmanagerinterop/nf-printmanagerinterop-iprintmanagerinterop-showprintuiforwindowasync) method.
114
-
- In a UWP app, use the [PrintManager.ShowPrintUIAsync](/uwp/api/windows.graphics.printing.printmanager.showprintuiasync) method.
Copy file name to clipboardExpand all lines: hub/apps/develop/devices-sensors/printing-and-scanning.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.localizationpriority: medium
11
11
12
12
# Printing and scanning
13
13
14
-
This section describes how to print and scan from your Windows app.
14
+
Windows apps can integrate with printers and scanners to let users print documents, images, and other content, or digitize physical media directly from your app. The Windows App SDK and Windows Runtime APIs provide built-in support for common printing tasks like customizing print preview, selecting printers, and configuring page settings, as well as scanning from flatbed, feeder, and auto-configured sources. This section walks you through the key scenarios for adding printing and scanning capabilities to your app.
0 commit comments