In the code below, you can see that I overrode OnEndPage
event and tried to add a paragraph to the document. However, I get an "System.StackOverflowException" error when attempting to run the code.
Does anyone have any idea why this is happening and how can I fix it?
public override void OnEndPage(PdfWriter writer, Document document)
{
base.OnEndPage(writer, document);
Paragraph p = new Paragraph("Paragraph");
document.Add(p);
}