DeliveryConfirmationsDialog: small fixes

This commit is contained in:
2023-10-19 22:35:31 +02:00
parent c190ce1474
commit 8ce4911317
3 changed files with 6 additions and 5 deletions

View File

@ -80,13 +80,14 @@ namespace Elwig.Documents {
if (this is MergedDocument m) {
var pdf = new TempFile("pdf");
var tmpHtmls = new List<TempFile>();
var n = 0;
var n = m.Documents.Count();
int i = 0;
foreach (var doc in m.Documents) {
var tmpHtml = new TempFile("html");
await File.WriteAllTextAsync(tmpHtml.FilePath, await doc.Render(), Utils.UTF8);
tmpHtmls.Add(tmpHtml);
n++;
progress?.Report(50.0 * n / m.Documents.Count());
i++;
progress?.Report(50.0 * i / n);
}
progress?.Report(50.0);
await Pdf.Convert(tmpHtmls.Select(f => f.FilePath), pdf.FilePath, new Progress<double>(v => progress?.Report(50.0 + v / 2)));