Document.NewPage () nie dodaje nowej strony

Próbuję dodać nową stronę do dokumentu pdf, jednak z jakiegoś powodu tak się nie dzieje. Może moje inne pytaniehttps://stackoverflow.com/questions/11428878/itextsharp-splitlate-not-working ma z tym coś wspólnego, ponieważ tabela w tym pytaniu nie ulega zerwaniu i nie są tworzone nowe strony. Oto kod, który mam do dodawania nowych stron:

Document doc = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4.Rotate(),20,20,20,40);
string rep1Name;                 // variable to hold the file name of the first part of the report
rep1Name = Guid.NewGuid().ToString() + ".pdf";

FileStream output = new FileStream(System.Web.HttpContext.Current.Server.MapPath("~/ReportGeneratedFiles/reports/" + rep1Name), FileMode.Create);
PdfWriter pdfWriter = PdfWriter.GetInstance(doc, output);

doc.Open();
doc.NewPage();
doc.NewPage();
doc.Close();

questionAnswers(1)

yourAnswerToTheQuestion