diff --git a/Elwig/Documents/Document.cs b/Elwig/Documents/Document.cs index d29699e..6295a9c 100644 --- a/Elwig/Documents/Document.cs +++ b/Elwig/Documents/Document.cs @@ -97,10 +97,10 @@ namespace Elwig.Documents { await File.WriteAllTextAsync(tmpHtml.FilePath, await doc.Render(), Utils.UTF8); tmpHtmls.Add(tmpHtml); i++; - progress?.Report(GenerationProportion * i / n); + progress?.Report(GenerationProportion * 100 * i / n); } - progress?.Report(GenerationProportion); - await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, DoubleSided, new Progress(v => progress?.Report(GenerationProportion + v * (1 - GenerationProportion)))); + progress?.Report(GenerationProportion * 100); + await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, DoubleSided, new Progress(v => progress?.Report(GenerationProportion * 100 + v * (1 - GenerationProportion)))); foreach (var tmp in tmpHtmls) { tmp.Dispose(); }