Documents: fix WinziPrint args

This commit is contained in:
2023-10-19 22:45:31 +02:00
parent 8ce4911317
commit e52475a4bf
3 changed files with 3 additions and 2 deletions

View File

@ -90,7 +90,7 @@ namespace Elwig.Documents {
progress?.Report(50.0 * i / n); progress?.Report(50.0 * i / n);
} }
progress?.Report(50.0); progress?.Report(50.0);
await Pdf.Convert(tmpHtmls.Select(f => f.FilePath), pdf.FilePath, new Progress<double>(v => progress?.Report(50.0 + v / 2))); await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, new Progress<double>(v => progress?.Report(50.0 + v / 2)));
foreach (var tmp in tmpHtmls) { foreach (var tmp in tmpHtmls) {
tmp.Dispose(); tmp.Dispose();
} }

View File

@ -21,7 +21,7 @@ namespace Elwig.Documents {
public static async Task Init(Action evtHandler) { public static async Task Init(Action evtHandler) {
var p = new Process() { StartInfo = new() { var p = new Process() { StartInfo = new() {
FileName = WinziPrint, FileName = WinziPrint,
Arguments = $"-p -e utf-8 -d '{App.TempPath}' -", Arguments = $"-p -e utf-8 -d \"{App.TempPath}\" -",
CreateNoWindow = true, CreateNoWindow = true,
UseShellExecute = false, UseShellExecute = false,
RedirectStandardInput = true, RedirectStandardInput = true,

View File

@ -5,6 +5,7 @@ namespace Elwig.Helpers {
public sealed class TempFile : IDisposable { public sealed class TempFile : IDisposable {
private int Usages = 0; private int Usages = 0;
public string FilePath { get; private set; } public string FilePath { get; private set; }
public string FileName => Path.GetFileName(FilePath);
public TempFile() : this(null) { } public TempFile() : this(null) { }