This commit is contained in:
@@ -526,6 +526,51 @@ namespace AyaNova.Biz
|
||||
log.LogDebug($"Resolving PDF Options from report settings");
|
||||
var PdfOptions = new PdfOptions() { };
|
||||
PdfOptions.DisplayHeaderFooter = report.DisplayHeaderFooter;
|
||||
if (report.DisplayHeaderFooter)
|
||||
{
|
||||
PdfOptions.HeaderTemplate = report.HeaderTemplate;
|
||||
PdfOptions.FooterTemplate = report.FooterTemplate;
|
||||
}
|
||||
|
||||
if (report.PaperFormat != ReportPaperFormat.NotSet)
|
||||
{
|
||||
switch (report.PaperFormat)
|
||||
{
|
||||
case ReportPaperFormat.A0:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.A0;
|
||||
break;
|
||||
case ReportPaperFormat.A1:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.A1;
|
||||
break;
|
||||
case ReportPaperFormat.A2:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.A2;
|
||||
break;
|
||||
case ReportPaperFormat.A3:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.A3;
|
||||
break;
|
||||
case ReportPaperFormat.A4:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.A4;
|
||||
break;
|
||||
case ReportPaperFormat.A5:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.A5;
|
||||
break;
|
||||
case ReportPaperFormat.A6:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.A6;
|
||||
break;
|
||||
case ReportPaperFormat.Ledger:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.Ledger;
|
||||
break;
|
||||
case ReportPaperFormat.Legal:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.Legal;
|
||||
break;
|
||||
case ReportPaperFormat.Letter:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.Letter;
|
||||
break;
|
||||
case ReportPaperFormat.Tabloid:
|
||||
PdfOptions.Format = PuppeteerSharp.Media.PaperFormat.Tabloid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//render to pdf and return
|
||||
log.LogDebug($"Calling render page contents to PDF");
|
||||
|
||||
Reference in New Issue
Block a user