XMLWorkerHelper convert html page into pdf produces only first 2 pages
<p>I'm getting only the first two page. I have a generated list of elements in the third page. When there are too many elements in my collection, all pages from there become blank in my pdf output</p>

<pre><code>  using (FileStream fs = new FileStream(filePath, FileMode.Create))
                {                        
                    Document document = new Document(PageSize.A4, 25, 25, 30, 30);
                    WebClient wc = new WebClient();
                    string htmlText = wc.DownloadString(textUrl);                      

                    PdfWriter pdfWriter = PdfWriter.GetInstance(document, fs);
                    document.Open();
                      // register all fonts in current computer
                    FontFactory.RegisterDirectories(); 
                    XMLWorkerFontProvider fontProvider = new XMLWorkerFontProvider();
                    using (var msHtml = new MemoryStream(System.Text.Encoding.Default.GetBytes(htmlText)))
                    {
                        //Set factories
                        var cssAppliers = new CssAppliersImpl(fontProvider);
                        var htmlContext = new HtmlPipelineContext(cssAppliers);

                        //HtmlPipelineContext htmlContext = new HtmlPipelineContext(null);
                        htmlContext.SetTagFactory(Tags.GetHtmlTagProcessorFactory());

                        //FontFactory.Register(arialuniTff);
                        string gishaTff = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "GISHA.TTF");
                        FontFactory.Register(gishaTff);

                        var worker = XMLWorkerHelper.GetInstance();
                        var cssStream = new FileStream(FolderMapPath("/css/style.css"), FileMode.Open);

                        worker.ParseXHtml(pdfWriter, document, msHtml, cssStream, new UnicodeFontFactory());
                    }

                    // Close the document
                    document.Close();

                    // Close the writer instance
                    pdfWriter.Close();
                }                   
</code></pre>

<p>Here is my cshtml code</p>