Files

54 lines
1.8 KiB
C#
Raw Permalink Normal View History

2021-10-23 02:59:47 +02:00
using NUnit.Framework;
using QuestPDF.Examples.Engine;
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
namespace QuestPDF.Examples
{
public class ShowOnceExample
{
[Test]
public void ShowOnce()
{
RenderingTest
.Create()
.ProduceImages()
.ShowResults()
.RenderDocument(container =>
{
container.Page(page =>
{
page.Margin(20);
page.Size(PageSizes.A7.Landscape());
2022-03-13 22:47:06 +01:00
page.PageColor(Colors.White);
2021-10-23 02:59:47 +02:00
2022-03-08 17:27:30 +01:00
page.Header().Text("With show once").SemiBold();
2021-10-23 02:59:47 +02:00
page.Content().PaddingVertical(5).Row(row =>
{
row.RelativeItem()
2021-10-23 02:59:47 +02:00
.Background(Colors.Grey.Lighten2)
.Border(1)
.Padding(5)
.ShowOnce()
.Text(Placeholders.Label());
row.RelativeItem(2)
2021-10-23 02:59:47 +02:00
.Border(1)
.Padding(5)
.Text(Placeholders.Paragraph());
});
page.Footer().Text(text =>
{
text.Span("Page ");
text.CurrentPageNumber();
text.Span(" out of ");
text.TotalPages();
});
});
});
}
}
}