Implemented the Inlined element

This commit is contained in:
Marcin Ziąbek
2021-10-11 01:48:12 +02:00
parent 5deea91fe4
commit 479915b68f
4 changed files with 329 additions and 5 deletions
+49
View File
@@ -0,0 +1,49 @@
using System;
using System.Linq;
using NUnit.Framework;
using QuestPDF.Examples.Engine;
using QuestPDF.Fluent;
using QuestPDF.Helpers;
namespace QuestPDF.Examples
{
public class InlinedExamples
{
[Test]
public void Inlined()
{
RenderingTest
.Create()
.PageSize(800, 575)
.FileName()
.ProduceImages()
.ShowResults()
.Render(container =>
{
container
.Padding(25)
.Border(1)
.Background(Colors.Grey.Lighten2)
.Inlined(inlined =>
{
inlined.Spacing(25);
inlined.AlignCenter();
inlined.BaselineMiddle();
var random = new Random();
foreach (var _ in Enumerable.Range(0, 50))
{
inlined
.Item()
.Border(1)
.Width(random.Next(1, 5) * 25)
.Height(random.Next(1, 5) * 25)
.Background(Placeholders.BackgroundColor());
}
});
});
}
}
}