Hi,
I need some sample examples regarding convertions of html to pdf,i tried with many examples that one one is working for form type and another one is working with file type.Essential objects is working for both but while converting to pdf some contents in the html are missings can i know the reason. this is my code
//string Url = "https://v16smoke.smartappbeta.com/enterprisedesktop/DocumentItemDetails.aspx?smartItemId=530085&sessionid=b4ff4d2474b74e23b946cba377c4e6db&pageMode=view";
//HtmlToPdfOptions pdfOptions = new HtmlToPdfOptions();
//pdfOptions.AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit;
//pdfOptions.TriggerMode = HtmlToPdfTriggerMode.Auto;
//HtmlToPdf.Options.StartPageIndex = 1;
//HtmlToPdf.Options.StartPosition = 0;
//pdfOptions.AutoAdjustForDPI = false;
//pdfOptions.PageSize = PdfPageSizes.A4;
//EO.Pdf.HtmlToPdf.Options.OutputArea = new System.Drawing.RectangleF(0.5f, 0.5f, 10f, 10f);
//HtmlToPdf.Options.ZoomLevel = 1;
//HtmlToPdfResult pdf = EO.Pdf.HtmlToPdf.ConvertUrl(Url, @"C:\Pictures\Documenttype.pdf", pdfOptions);
can any solve my prblm,
Thanks
Tuhin PaulPosted Apr 28, 2023, 2:19 AM
Marvelous reply @Amit Mohanty , +50 upvotes!
Here I am sharing my version!
Sharing you the code for iTextSharp which is used to convert from HTML to PDF.
This code reads the contents of an HTML file and writes it to a PDF file using iTextSharp's XMLWorkerHelper class. Some content from the HTML file may be missing in the resulting PDF file, depending on the complexity of the HTML and the capabilities of the PDF conversion library.
Amit MohantyPosted Apr 6, 2023, 3:48 AM
To convert an HTML string to a PDF file, you can use a third-party library like iTextSharp, IronPDF, or Select.Pdf.
Here is an example using iTextSharp:
Here is an example using Select.Pdf:
Here is an example using IronPDF:
Marvin ReidPosted Apr 5, 2023, 9:23 PM
You can pass the URL into the DocumentConverter and convert the HTML to PDF. This should include the missing contents. Here is some sample code which demonstrates this.
https://www.leadtools.com/help/sdk/tutorials/dotnet-convert-files-with-the-document-converter.html
Rahul PrasadPosted Sep 8, 2016, 9:22 PM