From e52475a4bfc6b3d1bfa82681bb33ddf1254d17dd Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 19 Oct 2023 22:45:31 +0200 Subject: [PATCH] Documents: fix WinziPrint args --- Elwig/Documents/Document.cshtml.cs | 2 +- Elwig/Documents/Pdf.cs | 2 +- Elwig/Helpers/TempFile.cs | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Elwig/Documents/Document.cshtml.cs b/Elwig/Documents/Document.cshtml.cs index c7d17e8..0033037 100644 --- a/Elwig/Documents/Document.cshtml.cs +++ b/Elwig/Documents/Document.cshtml.cs @@ -90,7 +90,7 @@ namespace Elwig.Documents { progress?.Report(50.0 * i / n); } progress?.Report(50.0); - await Pdf.Convert(tmpHtmls.Select(f => f.FilePath), pdf.FilePath, new Progress(v => progress?.Report(50.0 + v / 2))); + await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, new Progress(v => progress?.Report(50.0 + v / 2))); foreach (var tmp in tmpHtmls) { tmp.Dispose(); } diff --git a/Elwig/Documents/Pdf.cs b/Elwig/Documents/Pdf.cs index 377cafb..7b0cecf 100644 --- a/Elwig/Documents/Pdf.cs +++ b/Elwig/Documents/Pdf.cs @@ -21,7 +21,7 @@ namespace Elwig.Documents { public static async Task Init(Action evtHandler) { var p = new Process() { StartInfo = new() { FileName = WinziPrint, - Arguments = $"-p -e utf-8 -d '{App.TempPath}' -", + Arguments = $"-p -e utf-8 -d \"{App.TempPath}\" -", CreateNoWindow = true, UseShellExecute = false, RedirectStandardInput = true, diff --git a/Elwig/Helpers/TempFile.cs b/Elwig/Helpers/TempFile.cs index 484540f..2d42e9d 100644 --- a/Elwig/Helpers/TempFile.cs +++ b/Elwig/Helpers/TempFile.cs @@ -5,6 +5,7 @@ namespace Elwig.Helpers { public sealed class TempFile : IDisposable { private int Usages = 0; public string FilePath { get; private set; } + public string FileName => Path.GetFileName(FilePath); public TempFile() : this(null) { }