Documents/Pdf: allow double-sided pages to be printed
This commit is contained in:
		| @@ -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; | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user