5
Answers

Missing some of the line in pdf when converting HTML to PDF

petchiammal M

petchiammal M

9y
960
1
 I am converting html text to pdf using ITextSharf, my html text contains above 2000 lines with table. but in generated pdf some of the tr tag in  end of the html table is missing. and repeating from first tr tag in table.
 for example in my html file have 2250 tr tag in html table means , only first 810 tr tag value getting displyed and again displayed from first tr tag in generated pdf.

my code is here..

pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
                pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
                pdfConverter.PdfDocumentOptions.ShowHeader = false;
                pdfConverter.PdfDocumentOptions.ShowFooter = false;          
                pdfConverter.PdfDocumentOptions.LeftMargin = 10;
                pdfConverter.PdfDocumentOptions.RightMargin = 10;
                pdfConverter.PdfDocumentOptions.TopMargin = 16;
                pdfConverter.PdfDocumentOptions.BottomMargin = 30;
                pdfConverter.PdfDocumentOptions.GenerateSelectablePdf = true;
                pdfConverter.PdfDocumentOptions.ShowHeader = false;
                pdfConverter.AvoidTextBreak = true;
                pdfConverter.PdfFooterOptions.FooterTextColor = System.Drawing.Color.Blue;
                pdfConverter.PdfFooterOptions.DrawFooterLine = false;
                pdfConverter.PdfFooterOptions.PageNumberText = "Page";
                pdfConverter.PdfFooterOptions.ShowPageNumber = true;


                strFileNamePDF = "AdvancedSearch" + "_" + DateTime.Now.ToString("MM/dd/yyyy").Replace("/", "-") + "_" + DateTime.Now.ToString("hh:mm:ss.fff tt").Replace(":", "-");
                ObjPatSrch.CreatedDate = DateTime.Now;
                strPath = Server.MapPath("~/DocumentsManagement/ScannedCopies/Advanced Search/" + strFileNamePDF + ".pdf");
               
                sTxt = tempText.Value;
                pdfConverter.SavePdfFromHtmlStringToFileWithTempFile(sTxt, strPath);

in that code sTxt is my Html text.

pls help me anyone know the solution for this.




 
Answers (5)