Hi All,
Hi Srini,
Thanks for contacting support. I have tested the scenario using Aspose.Pdf for .NET 9.5.0 where I have used the following code snippet and I am unable to notice any issue. The PDF file is properly converted.
C#
// Load the HTML file
Document doc = new Document(
@"C:\pdftest\htmlsample(1)\sample\5340117181.html",
new HtmlLoadOptions()
);
doc.Save(@"C:\pdftest\htmlsample(1)\sample\5340117181.pdf");
Hello,
Hi Srini,
Thanks for your feedback. Please check a sample code snippet to convert HTML to PDF using external source files. As described in HTML to PDF conversion documentation link, you need to define base path to refer your external resources. Then complete path for external source will be comprise basepath+path in html tag. Hopefully it will help you to accomplish the task.
// Specify the The base path/url for
the html file which serves as images/css database
String basePath = `"E:/temp/"`;
HtmlLoadOptions htmloptions = new HtmlLoadOptions(basePath);
// load HTML file
Document doc = new Document("E:/temp/PDFtoHTML.html", htmloptions);
// Save HTML file
doc.Save("E:/temp/HTMLtoPDF.pdf")
Please feel free to contact us for any further assistance.
Best Regards,
Hello,
Document pdfDocument = new Document(Server.MapPath(@"/CCDS.pdf"));
string outHtmlFile = Server.MapPath("/HTML/SourcePdfHtml.html");<span style="color:green;">// Create HtmlSaveOption with tested feature</span> <span style="color:#2b91af;">HtmlSaveOptions</span> saveOptions = <span style="color:blue;">new</span> <span style="color:#2b91af;">HtmlSaveOptions</span>(); saveOptions.FixedLayout = <span style="color:blue;">true</span>; saveOptions.RasterImagesSavingMode = <span style="color:#2b91af;">HtmlSaveOptions</span>.<span style="color:#2b91af;">RasterImagesSavingModes</span>.AsEmbeddedPartsOfPngPageBackground; pdfDocument.Save(outHtmlFile, saveOptions);</pre></div><div><br></div><div>2)HTML to PDF</div><div><br></div><div> <span style="font-family: Consolas; font-size: 13px; color: rgb(43, 145, 175);">String</span><span style="font-family: Consolas; font-size: 13px; background-color: white;"> basePath = Server.MapPath(</span><span style="font-family: Consolas; font-size: 13px; color: rgb(163, 21, 21);">"HTML"</span><span style="font-family: Consolas; font-size: 13px; background-color: white;">);</span></div><pre style="font-family: Consolas; font-size: 13px; background: white;"> <span style="color:#2b91af;">HtmlLoadOptions</span> htmloptions = <span style="color:blue;">new</span> <span style="color:#2b91af;">HtmlLoadOptions</span>(basePath); <span style="color:green;">// use the new conversion engine</span> htmloptions.UseNewConversionEngine = <span style="color:blue;">true</span>; <span style="color:green;">// load HTML file</span> <span style="color:#2b91af;">Document</span> doc = <span style="color:blue;">new</span> <span style="color:#2b91af;">Document</span>(basePath + <span style="color:#a31515;">@"\SourcePdfHtml.html"</span>, htmloptions); <span style="color:green;">// Save HTML file</span> doc.Save(basePath + <span style="color:#a31515;">@"\output.pdf"</span>);</pre><div><br></div><div>Thanks,</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>
Its very urgent for me to release.
Hi Srini,
Any update plz?
Hi Srini,
Hello,
Hi Srini,
Hi Srini,
The issues you have found earlier (filed as PDFNEWNET-37465) have been fixed in Aspose.Pdf for .NET 10.3.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.