RepeatContentExamples.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Linq;
  2. using NUnit.Framework;
  3. using QuestPDF.Examples.Engine;
  4. using QuestPDF.Fluent;
  5. using QuestPDF.Helpers;
  6. namespace QuestPDF.Examples
  7. {
  8. public class RepeatContentExamples
  9. {
  10. [Test]
  11. public void ItemTypes()
  12. {
  13. RenderingTest
  14. .Create()
  15. .ProducePdf()
  16. .PageSize(PageSizes.A4)
  17. .ShowResults()
  18. .Render(container =>
  19. {
  20. container
  21. .Padding(25)
  22. .Decoration(decoration =>
  23. {
  24. decoration.Before().Text("Test").FontSize(22);
  25. decoration.Content().Column(column =>
  26. {
  27. column.Spacing(20);
  28. foreach (var _ in Enumerable.Range(0, 10))
  29. column.Item().Background(Colors.Grey.Medium).ExtendHorizontal().Height(80);
  30. });
  31. });
  32. });
  33. }
  34. }
  35. }