| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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());
- page.PageColor(Colors.White);
- page.Header().Text("With show once").SemiBold();
-
- page.Content().PaddingVertical(5).Row(row =>
- {
- row.RelativeItem()
- .Background(Colors.Grey.Lighten2)
- .Border(1)
- .Padding(5)
- .ShowOnce()
- .Text(Placeholders.Label());
-
- row.RelativeItem(2)
- .Border(1)
- .Padding(5)
- .Text(Placeholders.Paragraph());
- });
-
- page.Footer().Text(text =>
- {
- text.Span("Page ");
- text.CurrentPageNumber();
- text.Span(" out of ");
- text.TotalPages();
- });
- });
- });
- }
- }
- }
|