Added scaling options for AspectRatio and Image component. Added Debug component to the fluent API

This commit is contained in:
Marcin Ziąbek
2021-03-22 11:49:27 +01:00
parent 9c05c182b8
commit 5e9ff7ec1e
14 changed files with 133 additions and 79 deletions
+2 -2
View File
@@ -19,8 +19,8 @@ namespace QuestPDF.ReportSample
HeaderFields = HeaderFields(),
LogoData = Helpers.GetImage("logo.png"),
Sections = Enumerable.Range(0, 10).Select(x => GenerateSection()).ToList(),
Photos = Enumerable.Range(0, 10).Select(x => GetReportPhotos()).ToList()
Sections = Enumerable.Range(0, 8).Select(x => GenerateSection()).ToList(),
Photos = Enumerable.Range(0, 8).Select(x => GetReportPhotos()).ToList()
};
List<ReportHeaderField> HeaderFields()
@@ -38,10 +38,10 @@ namespace QuestPDF.ReportSample.Layouts
frame.Text(text.Text, Typography.Normal);
if (part is ReportSectionMap map)
frame.Element(container => MapElement(container, map));
frame.Element(x => MapElement(x, map));
if (part is ReportSectionPhotos photos)
frame.Element(container => PhotosElement(container, photos));
frame.Element(x => PhotosElement(x, photos));
});
}
});
@@ -56,7 +56,7 @@ namespace QuestPDF.ReportSample.Layouts
return;
}
container.Stack(stack =>
container.PageableStack(stack =>
{
stack.Spacing(5);
@@ -75,7 +75,7 @@ namespace QuestPDF.ReportSample.Layouts
var rowCount = (int) Math.Ceiling(model.Photos.Count / 3f);
container.Padding(-2).Stack(stack =>
container.Debug().Padding(-2).PageableStack(stack =>
{
foreach (var rowId in Enumerable.Range(0, rowCount))
{
+1 -1
View File
@@ -27,7 +27,7 @@ namespace QuestPDF.ReportSample
public void PerformanceBenchmark()
{
// test size
const int testSize = 1000;
const int testSize = 250;
const decimal performanceTarget = 5; // documents per second
// create report models
+2 -2
View File
@@ -5,8 +5,8 @@ namespace QuestPDF.ReportSample
{
public static class Typography
{
public static TextStyle Title => TextStyle.Default.FontType("Helvetica").Color("#000000").Size(20).Bold();
public static TextStyle Headline => TextStyle.Default.FontType("Helvetica").Color("#047AED").Size(14);
public static TextStyle Title => TextStyle.Default.FontType("Helvetica").Color("#000000").Size(22).SemiBold();
public static TextStyle Headline => TextStyle.Default.FontType("Helvetica").Color("#047AED").Size(14).SemiBold();
public static TextStyle Normal => TextStyle.Default.FontType("Helvetica").Color("#000000").Size(10).LineHeight(1.25f).AlignLeft();
}
}