Document: Add GenerationProportion and set to 1/8
This commit is contained in:
@ -11,6 +11,8 @@ namespace Elwig.Documents {
|
|||||||
|
|
||||||
public static string Name => "Dokument";
|
public static string Name => "Dokument";
|
||||||
|
|
||||||
|
private static readonly double GenerationProportion = 0.125;
|
||||||
|
|
||||||
private TempFile? _pdfFile = null;
|
private TempFile? _pdfFile = null;
|
||||||
|
|
||||||
public bool ShowFoldMarks = App.Config.Debug;
|
public bool ShowFoldMarks = App.Config.Debug;
|
||||||
@ -95,10 +97,10 @@ namespace Elwig.Documents {
|
|||||||
await File.WriteAllTextAsync(tmpHtml.FilePath, await doc.Render(), Utils.UTF8);
|
await File.WriteAllTextAsync(tmpHtml.FilePath, await doc.Render(), Utils.UTF8);
|
||||||
tmpHtmls.Add(tmpHtml);
|
tmpHtmls.Add(tmpHtml);
|
||||||
i++;
|
i++;
|
||||||
progress?.Report(25.0 * i / n);
|
progress?.Report(GenerationProportion * i / n);
|
||||||
}
|
}
|
||||||
progress?.Report(25.0);
|
progress?.Report(GenerationProportion);
|
||||||
await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, DoubleSided, new Progress<double>(v => progress?.Report(25.0 + v * 0.75)));
|
await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, DoubleSided, new Progress<double>(v => progress?.Report(GenerationProportion + v * (1 - GenerationProportion))));
|
||||||
foreach (var tmp in tmpHtmls) {
|
foreach (var tmp in tmpHtmls) {
|
||||||
tmp.Dispose();
|
tmp.Dispose();
|
||||||
}
|
}
|
||||||
|
@ -56,12 +56,14 @@ namespace Elwig.Windows {
|
|||||||
CommentInput.Text = v.Comment;
|
CommentInput.Text = v.Comment;
|
||||||
DateInput.Text = $"{v.Date:dd.MM.yyyy}";
|
DateInput.Text = $"{v.Date:dd.MM.yyyy}";
|
||||||
TransferDateInput.Text = $"{v.TransferDate:dd.MM.yyyy}";
|
TransferDateInput.Text = $"{v.TransferDate:dd.MM.yyyy}";
|
||||||
|
if (App.Config.Debug) {
|
||||||
try {
|
try {
|
||||||
var json = BillingData.ParseJson(v.Data);
|
var json = BillingData.ParseJson(v.Data);
|
||||||
DataInput.Text = JsonSerializer.Serialize(json, JsonOpt);
|
DataInput.Text = JsonSerializer.Serialize(json, JsonOpt);
|
||||||
} catch {
|
} catch {
|
||||||
DataInput.Text = v.Data;
|
DataInput.Text = v.Data;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
EditButton.Content = "Bearbeiten";
|
EditButton.Content = "Bearbeiten";
|
||||||
CopyButton.IsEnabled = false;
|
CopyButton.IsEnabled = false;
|
||||||
|
Reference in New Issue
Block a user