Skip to content

Commit 4583cea

Browse files
authored
Tweaks (#6332)
1 parent 9d4659b commit 4583cea

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

hub/apps/develop/devices-sensors/print-from-your-app.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ For more advanced features, see [Customize the print preview UI](customize-the-p
2323

2424
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.
2525

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-
2926
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.
3027

3128
> [!TIP]
@@ -65,7 +62,7 @@ private void RegisterForPrinting()
6562
```
6663

6764
> [!WARNING]
68-
> 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.
6966
7067
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.
7168

@@ -110,9 +107,6 @@ Add a print button to your app's screen where you'd like it to appear. Make sure
110107

111108
In the Button's Click event handler, show the Windows print UI to the user.
112109

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.
115-
116110
```csharp
117111
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(App.MainWindow);
118112
await PrintManagerInterop.ShowPrintUIForWindowAsync(hWnd);

hub/apps/develop/devices-sensors/printing-and-scanning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.localizationpriority: medium
1111

1212
# Printing and scanning
1313

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.
1515

1616
| Topic | Description |
1717
|-------|-------------|

hub/apps/develop/toc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,9 @@ items:
225225
- name: Overview
226226
href: devices-and-sensors.md
227227
- name: Printing and scanning
228-
href: devices-sensors/printing-and-scanning.md
229228
items:
229+
- name: Overview
230+
href: devices-sensors/printing-and-scanning.md
230231
- name: Print from your app
231232
href: devices-sensors/print-from-your-app.md
232233
- name: Customize the print preview UI

0 commit comments

Comments
 (0)