diff --git a/Elwig/Helpers/Printing/Pdf.cs b/Elwig/Helpers/Printing/Pdf.cs index 1992493..fab4ee5 100644 --- a/Elwig/Helpers/Printing/Pdf.cs +++ b/Elwig/Helpers/Printing/Pdf.cs @@ -26,7 +26,7 @@ namespace Elwig.Helpers.Printing { private static Process? WinziPrintProc; public static bool IsReady => WinziPrintProc != null; - public static Task Init(Action? evtHandler = null) { + public static async Task Init(Action? evtHandler = null) { // NOTE: If the WinziPrint daemon is already running this will succeed, but the process will fail. // Should be no problem, as long as the daemon is not closed var p = new Process() { StartInfo = new() { @@ -38,9 +38,9 @@ namespace Elwig.Helpers.Printing { p.StartInfo.ArgumentList.Add("-d"); p.StartInfo.ArgumentList.Add(App.TempPath); p.Start(); + await Task.Delay(1000); WinziPrintProc = p; evtHandler?.Invoke(); - return Task.CompletedTask; } public static Task Cleanup() {