Issues with HTML + external CSS

Hi,

I have a question about Aspose.PDF component: It is not taking external CSS styles I am using latest 7.x version). The output rendered when parsing an HTML page with CSS styles is very different from what the page looks like.

Does Aspose.PDF works with external style sheets? We are evaluating another product, HiQ PDF which renders perfectly fine. Can you guide us?

Vivek

Hi Vivek,

Thank you for considering Aspose.Pdf.

Yes, Aspose.Pdf for .NET does support external style sheets while conversion from HTML to PDF.
To figure out the issue, I would request you to share your template HTML and CSS files with us. We will check it and get back to you soon.

Sorry for the inconvenience,

Hi,


I have attached the HTML file (some images might be missing but thats okay). I tried to convert this page using Aspose.PDF and HiQPdf (another tool like Aspose.PDF). HiQPDF works perfectly fine, but Aspose.PDF messes up. I have attached both the PDF results.

Please let me know the issue.

Vivek

Hi Vivek,


Thanks for sharing the resource files and sorry for replying you late.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34318. We will investigate this
issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

Hi,


Any updates on this issue? We need to buy Apose PDF.NET and this issue is holding up our purchase.

Please let me know when can we expect a fix.

Thanks,

Vivek

Hi Vivek,


As recently we have been able to notice this issue, so I am afraid currently we are not able to share any ETA regarding its resolution. However as soon as we have made some progress towards its resolution, we would be more than happy to update you with the status of correction. Please be patient and spare us little time. We are sorry for this delay and inconvenience.

Is this issue resolved in latest release?

Hi Vivek,

Thanks for your inquiry. I have tested the HTML to PDF scenario using your sample HTML files with new DOM approach of HTML to PDF conversion and unable to notice any external CSS formatting issue. Please note while converting HTML to PDF, you may pass basepath of external resources(CSS/Images/Fonts etc) to HtmlLoadOptions object as following.

Please download the latest version of Aspose.Pdf for .NET, try the following code snippet and share the results. Hopefully it will help you to resolve the issue.

HtmlLoadOptions options = new HtmlLoadOptions(@"D:\Downloads\Aspose+HTML\Aspose HTML\");

Document doc = new Document(@"D:\Downloads\Aspose+HTML\Aspose HTML\terminator.htm", options);

doc.Save(myDir+"htmltopdf.pdf");

We are sorry for the inconvenience.

Best Regards,