StopPaging.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using NUnit.Framework;
  2. using QuestPDF.Examples.Engine;
  3. using QuestPDF.Fluent;
  4. using QuestPDF.Helpers;
  5. using QuestPDF.Infrastructure;
  6. namespace QuestPDF.Examples
  7. {
  8. public class StopPaging
  9. {
  10. [Test]
  11. public void Example()
  12. {
  13. RenderingTest
  14. .Create()
  15. .PageSize(300, 250)
  16. .ProduceImages()
  17. .ShowResults()
  18. .Render(container =>
  19. {
  20. container
  21. .Padding(25)
  22. .DefaultTextStyle(TextStyle.Default.Size(14))
  23. .Decoration(decoration =>
  24. {
  25. decoration
  26. .Before()
  27. .Text(text =>
  28. {
  29. text.DefaultTextStyle(TextStyle.Default.SemiBold().Color(Colors.Blue.Medium));
  30. text.Span("Page ");
  31. text.CurrentPageNumber();
  32. });
  33. decoration
  34. .Content()
  35. .Column(column =>
  36. {
  37. column.Spacing(25);
  38. column.Item().StopPaging().Text(Placeholders.LoremIpsum());
  39. column.Item().ExtendHorizontal().Height(75).Background(Colors.Grey.Lighten2);
  40. });
  41. });
  42. });
  43. }
  44. }
  45. }