From d741ba92dccc20108769b96c3a9525213293089b Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Tue, 23 Jul 2024 11:42:23 +0200 Subject: [PATCH] Printing/Pdf: Set CreateNoWindow to true --- Elwig/Helpers/Printing/Pdf.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Elwig/Helpers/Printing/Pdf.cs b/Elwig/Helpers/Printing/Pdf.cs index 2eefdb0..f270988 100644 --- a/Elwig/Helpers/Printing/Pdf.cs +++ b/Elwig/Helpers/Printing/Pdf.cs @@ -94,7 +94,11 @@ namespace Elwig.Helpers.Printing { public static async Task Print(string path, int copies = 1) { try { - var p = new Process() { StartInfo = new() { FileName = PdfToPrinter } }; + var p = new Process() { StartInfo = new() { + FileName = PdfToPrinter, + CreateNoWindow = true, + UseShellExecute = false, + } }; p.StartInfo.ArgumentList.Add(path); p.StartInfo.ArgumentList.Add("/s"); p.StartInfo.ArgumentList.Add($"copies={copies}");