Documents/Pdf: allow double-sided pages to be printed

This commit is contained in:
2023-10-23 22:25:32 +02:00
parent d5102c9cd7
commit 8792404e0d
6 changed files with 48 additions and 14 deletions

View File

@ -11,6 +11,7 @@ namespace Elwig.Documents {
private TempFile? _pdfFile = null;
public bool ShowFoldMarks = App.Config.Debug;
public bool DoubleSided = false;
public string DataPath;
public int CurrentNextSeason;
@ -90,7 +91,7 @@ namespace Elwig.Documents {
progress?.Report(50.0 * i / n);
}
progress?.Report(50.0);
await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, new Progress<double>(v => progress?.Report(50.0 + v / 2)));
await Pdf.Convert(tmpHtmls.Select(f => f.FileName), pdf.FileName, DoubleSided, new Progress<double>(v => progress?.Report(50.0 + v / 2)));
foreach (var tmp in tmpHtmls) {
tmp.Dispose();
}
@ -100,7 +101,7 @@ namespace Elwig.Documents {
using (var tmpHtml = new TempFile("html")) {
await File.WriteAllTextAsync(tmpHtml.FilePath, await Render(), Utils.UTF8);
progress?.Report(50.0);
await Pdf.Convert(tmpHtml.FilePath, pdf.FilePath);
await Pdf.Convert(tmpHtml.FilePath, pdf.FilePath, DoubleSided);
}
_pdfFile = pdf;
}