Added scaling options for AspectRatio and Image component. Added Debug component to the fluent API
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user