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 SkipOnceExample
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void SkipOnce()
|
|
|
|
|
{
|
|
|
|
|
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-01-09 00:11:34 +01:00
|
|
|
page.Header().Column(column =>
|
2021-10-23 02:59:47 +02:00
|
|
|
{
|
2022-01-09 00:11:34 +01:00
|
|
|
column.Item().ShowOnce().Text("This header is visible on the first page.");
|
|
|
|
|
column.Item().SkipOnce().Text("This header is visible on the second page and all following.");
|
2021-10-23 02:59:47 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
page.Content()
|
|
|
|
|
.PaddingVertical(10)
|
2022-03-09 22:13:51 +01:00
|
|
|
.Text(Placeholders.Paragraphs())
|
2022-03-11 13:23:36 +01:00
|
|
|
.FontColor(Colors.Grey.Medium);
|
2021-10-23 02:59:47 +02:00
|
|
|
|
|
|
|
|
page.Footer().Text(text =>
|
|
|
|
|
{
|
|
|
|
|
text.Span("Page ");
|
|
|
|
|
text.CurrentPageNumber();
|
|
|
|
|
text.Span(" out of ");
|
|
|
|
|
text.TotalPages();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|