我需要从HTML生成包含近2000行表格的PDF。当我尝试生成PDF时,它生成最多250行,然后跳过其他行和HTML内容,只生成6页。可能导致这个问题的原因是什么?
string HtmlStream="Some large content", string FileName="abcd.pdf";
object TargetFile = FileName;
string ModifiedFileName = string.Empty;
string FinalFileName = string.Empty;
ModifiedFileName = TargetFile.ToString();
ModifiedFileName = ModifiedFileName.Insert(ModifiedFileName.Length - 4, "1");
SelectPdf.HtmlToPdf converter = new SelectPdf.HtmlToPdf();
// set converter options
string pdf_page_size = "A4";
SelectPdf.PdfPageSize pageSize = (SelectPdf.PdfPageSize)Enum.Parse(typeof(SelectPdf.PdfPageSize),
pdf_page_size, true);
converter.Options.PdfPageSize = pageSize;
converter.Options.PdfPageOrientation = SelectPdf.PdfPageOrientation.Portrait;
converter.Options.MarginLeft = 10;
converter.Options.MarginRight = 10;
converter.Options.MarginTop = 10;
converter.Options.MarginBottom = 10;
converter.Options.MaxPageLoadTime = 1000;
// create a new pdf document converting an url
SelectPdf.PdfDocument doc = converter.ConvertHtmlString(HtmlStream);
doc.Save(ModifiedFileName.ToString());