Previewer improvements

This commit is contained in:
MarcinZiabek
2022-03-31 23:11:34 +02:00
parent c137bcfcde
commit 9e7a1ed49d
7 changed files with 65 additions and 77 deletions
+3 -34
View File
@@ -1,14 +1,10 @@
using System.Net.Http.Headers;
using Avalonia.Media;
using QuestPDF.Fluent;
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
using QuestPDF.Previewer;
using QuestPDF.ReportSample;
using QuestPDF.ReportSample.Layouts;
using Colors = QuestPDF.Helpers.Colors;
ImagePlaceholder.Solid = true;
//ImagePlaceholder.Solid = true;
// var model = DataSource.GetReport();
// var report = new StandardReport(model);
@@ -51,16 +47,6 @@ Document
});
x.Item().Text("Modify this line and the preview should show your changes instantly.");
// for testing exception handling
// try
// {
// throw new ArgumentException("This file does not exists... peace.png");
// }
// catch (Exception e)
// {
// throw new FileNotFoundException("This is the top exception!", e);
// }
});
page.Footer()
@@ -71,22 +57,5 @@ Document
x.CurrentPageNumber();
});
});
container.Page(page =>
{
page.Size(PageSizes.A4);
page.Margin(2, Unit.Centimetre);
page.DefaultTextStyle(x => x.FontSize(20));
page.Content()
.PaddingVertical(1, Unit.Centimetre)
.Column(x =>
{
x.Spacing(20);
foreach (var i in Enumerable.Range(0, 10))
x.Item().Background(Colors.Grey.Lighten2).Height(80);
});
});
})
.ShowInPreviewer().Wait();
.ShowInPreviewer();