Is it possible to using QuestPDF when generating PDFs to have some content repeat on new pages?
The scenario I have is I am looping over 2 collections (headings & items) and it can span across an unknown number of pages.
Here is how I am currently printing the document.
page.Content().Column(column =>
{
column.Spacing(5);
for (int i = 0; i < random.Next(1, 10); i++)
{
//How to repeat this heading if the below loop spans multiple pages?
column.Item().Background(Colors.Red.Accent4).AlignLeft().Padding(2).Text($" Heading {i}");
for (int j = 0; j < random.Next(1, 20); j++)
{
column.Item().Row(row =>
{
row.ConstantItem(100).Text(DateTime.Now.ToShortDateString());
row.ConstantItem(100).Text($"{i}. ");
row.RelativeItem().ShowEntire().Text($"Some long text that potientially wraps");
row.ConstantItem(100).AlignRight().Text("ABC");
});
}
}
});
What I want to achieve is to repeat the heading every time a new page is created so I can print "Heading {i} continued"
Is there a way to achieve this? I tried using a combination of page.Header()
and ShowIf
but the header doesn't seem to be hit the second time.