How to Silent print from an UWP Application

后端 未结 3 806
滥情空心
滥情空心 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:35

    I am using RawPrint nuget to print silently in UWP:

    https://github.com/frogmorecs/RawPrint

    Sample:

      ...
    
      if (file != null)
      {
          IPrinter printer = new Printer();
          var stream = await file.OpenStreamForReadAsync();
          printer.PrintRawStream("Brother DCP-L2540DN series Printer", stream, file.DisplayName);
      }
    

提交回复
热议问题