2022-01-09 00:11:34 +01:00
|
|
|
using System.IO;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using QuestPDF.Examples.Engine;
|
|
|
|
|
using QuestPDF.Fluent;
|
|
|
|
|
using QuestPDF.Helpers;
|
2022-01-30 22:52:56 +01:00
|
|
|
using QuestPDF.Infrastructure;
|
2022-01-09 00:11:34 +01:00
|
|
|
|
|
|
|
|
namespace QuestPDF.Examples
|
|
|
|
|
{
|
|
|
|
|
public class LineExamples
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void LineHorizontal()
|
|
|
|
|
{
|
|
|
|
|
RenderingTest
|
|
|
|
|
.Create()
|
|
|
|
|
.PageSize(PageSizes.A5)
|
2022-01-30 22:52:56 +01:00
|
|
|
.ProduceImages()
|
2022-01-09 00:11:34 +01:00
|
|
|
.ShowResults()
|
|
|
|
|
.Render(container =>
|
|
|
|
|
{
|
2022-01-30 22:52:56 +01:00
|
|
|
container
|
|
|
|
|
.Padding(15)
|
|
|
|
|
.MinimalBox()
|
|
|
|
|
.DefaultTextStyle(TextStyle.Default.Size(16))
|
|
|
|
|
.Column(column =>
|
|
|
|
|
{
|
|
|
|
|
column.Item().Text("Above text");
|
|
|
|
|
column.Item().PaddingVertical(5).LineHorizontal(1).LineColor(Colors.Grey.Medium);
|
|
|
|
|
column.Item().Text("Below text");
|
|
|
|
|
});
|
2022-01-09 00:11:34 +01:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void LineVertical()
|
|
|
|
|
{
|
|
|
|
|
RenderingTest
|
|
|
|
|
.Create()
|
|
|
|
|
.PageSize(PageSizes.A5)
|
2022-01-30 22:52:56 +01:00
|
|
|
.ProduceImages()
|
2022-01-09 00:11:34 +01:00
|
|
|
.ShowResults()
|
|
|
|
|
.Render(container =>
|
|
|
|
|
{
|
2022-01-30 22:52:56 +01:00
|
|
|
container
|
|
|
|
|
.Padding(15)
|
|
|
|
|
.DefaultTextStyle(TextStyle.Default.Size(16))
|
|
|
|
|
.Row(row =>
|
|
|
|
|
{
|
|
|
|
|
row.AutoItem().Text("Left text");
|
|
|
|
|
row.AutoItem().PaddingHorizontal(10).LineVertical(1).LineColor(Colors.Grey.Medium);
|
|
|
|
|
row.AutoItem().Text("Right text");
|
|
|
|
|
});
|
2022-01-09 00:11:34 +01:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|