How to Silent print from an UWP Application

后端 未结 3 814
滥情空心
滥情空心 2020-12-03 09:14

I am trying to make a Print application on UWP, but the samples show

await Windows.Graphics.Printing.PrintManager.ShowPrintUIAsync();

This

3条回答
  •  被撕碎了的回忆
    2020-12-03 09:54

    The current UWP API does not support silent printing, i.e. without explicit user interaction.

    For POS scenarios UWP does offer the POSPrinter API - this may or may not apply to your scenario though:

    https://docs.microsoft.com/en-us/uwp/api/Windows.Devices.PointOfService.PosPrinter

    https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/PosPrinter

    For LOB applications running on desktop, you also have the option to continue using your Win32 printing APIs from a fulltrust process included in your UWP app package. I have put together a quick sample that demonstrates this technique in the example of printing image files silently from a UWP:

    Store: https://www.microsoft.com/store/apps/9pd51nnkx3t2

    Source: https://1drv.ms/u/s!AovTwKUMywTNnOsbzlRfghOikDy8Dw

    It's certainly a valid feature request and we should extend the API to enable this scenario with the right user model in place (API, capability, settings, etc.) to ensure a proper user experience.

    Please vote here on UserVoice to help the team prioritize the feature: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/6185763-allow-direct-printing-without-modern-ui-print-dial

提交回复
热议问题