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.
Loading
petchiammal MPosted Mar 7, 2015, 7:03 AM
Thanks for your reply , here with i attached my html string, you find any issue in my code please let me know.
Richard PorterPosted Mar 5, 2015, 3:47 AM
The article's code uses a .NET component for Word documents.
Rahul BansalPosted Feb 27, 2015, 1:04 AM
petchiammal MPosted Feb 27, 2015, 12:46 AM
Rahul BansalPosted Feb 26, 2015, 2:16 AM
http://www.c-sharpcorner.com/UploadFile/a20beb/how-to-design-the-runtime-generated-pdf-via-html-code/