Fix PDFs not displaying right; use report title
This commit is contained in:
@@ -392,6 +392,13 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
footerPar.AddLineBreak();
|
footerPar.AddLineBreak();
|
||||||
footerPar.AddText("Report generated on " + DateTime.Now.ToString("f"));
|
footerPar.AddText("Report generated on " + DateTime.Now.ToString("f"));
|
||||||
section.Footers.Primary.Add(footerPar);
|
section.Footers.Primary.Add(footerPar);
|
||||||
|
// add report title
|
||||||
|
var reportTitlePar = section.AddParagraph();
|
||||||
|
reportTitlePar.Format.Alignment = ParagraphAlignment.Center;
|
||||||
|
reportTitlePar.Format.Font.Size = 16;
|
||||||
|
reportTitlePar.Format.Font.Bold = true;
|
||||||
|
reportTitlePar.Format.Font.Name = "Noto Sans JP"; // has english letters in it, too
|
||||||
|
reportTitlePar.AddText(ReportTitle);
|
||||||
//
|
//
|
||||||
GlobalFontSettings.FontResolver = this;
|
GlobalFontSettings.FontResolver = this;
|
||||||
GlobalFontSettings.FallbackFontResolver = new FailsafeFontResolver();
|
GlobalFontSettings.FallbackFontResolver = new FailsafeFontResolver();
|
||||||
@@ -469,7 +476,7 @@ class MainViewModel : BaseViewModel, IFontResolver
|
|||||||
section.AddPageBreak();
|
section.AddPageBreak();
|
||||||
paragraph = section.AddParagraph();
|
paragraph = section.AddParagraph();
|
||||||
paragraph.Format.Alignment = ParagraphAlignment.Center;
|
paragraph.Format.Alignment = ParagraphAlignment.Center;
|
||||||
image = paragraph.AddImage(file + "#" + j);
|
image = paragraph.AddImage(filePath + "#" + j);
|
||||||
image.LockAspectRatio = true;
|
image.LockAspectRatio = true;
|
||||||
image.Width = imageWidth;
|
image.Width = imageWidth;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user