| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using NUnit.Framework;
- using QuestPDF.Examples.Engine;
- using QuestPDF.Fluent;
- using QuestPDF.Helpers;
- using QuestPDF.Infrastructure;
- namespace QuestPDF.Examples
- {
- public class EnsureSpaceExample
- {
- [Test]
- public void EnsureSpaceWith()
- {
- 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 ensure space").SemiBold();
-
- page.Content().Column(column =>
- {
- column
- .Item()
- .ExtendHorizontal()
- .Height(75)
- .Background(Colors.Grey.Lighten2);
-
- column
- .Item()
- .EnsureSpace(100)
- .Text(Placeholders.LoremIpsum());
- });
-
- page.Footer().Text(text =>
- {
- text.Span("Page ");
- text.CurrentPageNumber();
- text.Span(" out of ");
- text.TotalPages();
- });
- });
- });
- }
- }
- }
|