Adjust footer, font sizes, image size

This commit is contained in:
2026-01-03 22:25:18 +09:00
parent 650659d1b7
commit 61991063a1
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -103,6 +103,7 @@ class MainViewModel : BaseViewModel, IFontResolver
var pdfDoc = new Document(); var pdfDoc = new Document();
var outputFileName = "MyReceipts.pdf"; var outputFileName = "MyReceipts.pdf";
var folderName = new DirectoryInfo(folderPath).Name; var folderName = new DirectoryInfo(folderPath).Name;
const int imageWidth = 425;
LogInfo("Folder name is " + folderName); LogInfo("Folder name is " + folderName);
if (folderName.Contains('-')) if (folderName.Contains('-'))
{ {
@@ -130,11 +131,14 @@ class MainViewModel : BaseViewModel, IFontResolver
// setup footer for page number // setup footer for page number
var footerPar = new Paragraph(); var footerPar = new Paragraph();
footerPar.Format.Alignment = ParagraphAlignment.Center; footerPar.Format.Alignment = ParagraphAlignment.Center;
footerPar.Format.Font.Size = 10;
footerPar.AddText("--Page "); footerPar.AddText("--Page ");
footerPar.AddPageField(); footerPar.AddPageField();
footerPar.AddText(" of "); footerPar.AddText(" of ");
footerPar.AddNumPagesField(); footerPar.AddNumPagesField();
footerPar.AddText("--"); footerPar.AddText("--");
footerPar.AddLineBreak();
footerPar.AddText("Report generated on " + DateTime.Now.ToString("f"));
section.Footers.Primary.Add(footerPar); section.Footers.Primary.Add(footerPar);
// //
var files = Directory.GetFiles(folderPath); var files = Directory.GetFiles(folderPath);
@@ -180,7 +184,7 @@ class MainViewModel : BaseViewModel, IFontResolver
paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Format.Alignment = ParagraphAlignment.Center;
var image = paragraph.AddImage(fileName); var image = paragraph.AddImage(fileName);
image.LockAspectRatio = true; image.LockAspectRatio = true;
image.Width = 400; // can't be too wide now...not sure why...maybe due to margins... image.Width = imageWidth; // can't be too wide now...not sure why...maybe due to margins...
LogInfo(string.Format("Added image: {0}", fileName)); LogInfo(string.Format("Added image: {0}", fileName));
if (isPDF) if (isPDF)
{ {
@@ -197,7 +201,7 @@ class MainViewModel : BaseViewModel, IFontResolver
paragraph.Format.Alignment = ParagraphAlignment.Center; paragraph.Format.Alignment = ParagraphAlignment.Center;
image = paragraph.AddImage(file + "#" + j); image = paragraph.AddImage(file + "#" + j);
image.LockAspectRatio = true; image.LockAspectRatio = true;
image.Width = 400; image.Width = imageWidth;
} }
} }
if (i < files.Length - 1) if (i < files.Length - 1)
+1
View File
@@ -10,6 +10,7 @@
<Grid ColumnDefinitions="Auto, *" <Grid ColumnDefinitions="Auto, *"
RowDefinitions="Auto, *"> RowDefinitions="Auto, *">
<Label Content="Easy Receipt Folder -> PDF Builder" <Label Content="Easy Receipt Folder -> PDF Builder"
FontSize="16"
Grid.Row="0" Grid.Row="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
FontWeight="Bold" FontWeight="Bold"