3

In my UWP application, I wanted to print a document without showing the print UI. Normally we use PrintManager.ShowPrintUIAsync()
But I wanted to print without showing the UI. In my Research, I found that there's no such thing in UWP to print directly without showing Preview. But it can be done through FullTrustProces Launcher (or) Brokered Component. I am unaware of both of this 2 processes. Can someone tell me the way to use them in detail or any other way to get print without showing the Preview or sending stream directly to the Printer?

Edit1: Someone tageed it as a duplicate, so i explained the difference between the 2 questions. It's not the duplicate of that question. My question clearly asks which process shall i use whether the FullTrustProcess Launcher or Brokered Component. The question that person tagged is asking whether there's a way to print silently. But my question is which method is best.

  • 1
    Possible duplicate of [How to Silent print from an UWP Application](https://stackoverflow.com/questions/46984595/how-to-silent-print-from-an-uwp-application) – Rafael Oct 11 '18 at 09:24
  • @Rafael it's not the duplicate of that question. My question clearly asks which process shall i use whether the **FullTrustProcess Launcher** or **Brokered Component**. The question You tagged is asking whether there's a way to print silently. But my question is which method is best. – Hari prasad kasavajjala Oct 12 '18 at 07:36

1 Answers1

2

No matter FullTrustProces Launcher (or) Brokered Component technology, they all call win32 APIs to achieve the silent print.

For the FullTrustProces Launcher, it actually is putting a win32 process in your UWP app package. The win32 process could be console application, Windows Forms app etc. Stefan has replied a similar thread. On that thread, Stefan has explained and provided a simple code sample, please check it.

You could also refer to this blog Desktop Bridge – The Migrate phase: invoking a Win32 process from a UWP app for more details.

For the Brokered Windows Runtime Components, it makes side-loaded Universal Windows Platform apps to interoperate with desktop processes outside of the app container possible. Please see Brokered Windows Runtime Components for a side-loaded UWP app for more details.

Xie Steven
  • 8,544
  • 1
  • 9
  • 23
  • our application is side loaded UWP, so shall i write a WPF application to print silently and then migrate it through Desktop Bridge or use Brokered Win RT ? If it is Brokered Win RT, Can u please tell me the way to use it, as i am unable to do it through microsoft docs – Hari prasad kasavajjala Aug 23 '18 at 06:44
  • 1
    @Hariprasadkasavajjala In general, it's simpler to use Desktop Bridge. You could check the sample on my above reply – Xie Steven Aug 23 '18 at 07:04