HTML to PDF - CSS Ignored?

We are trying to convert a HTML file to an PDF following the instructions found on this link :


http://www.aspose.com/docs/display/pdfnet/How+to+convert+HTML+to+PDF+using+InLineHTML+approach

However we noticed that CSS is not done correctly.
This is the code we use to generate the PDF file :

Dim p As New Pdf
p.HtmlInfo.ImgUrl = HttpContext.Current.Server.MapPath(“…/images/”)
p.HtmlInfo.ExternalResourcesBasePath = HttpContext.Current.Server.MapPath(“…/styles/”)
Dim sect As Section = p.Sections.Add
Dim r As StreamReader = File.OpenText(HttpContext.Current.Server.MapPath(“…/templates/templatetest.html”))

Dim text As Text = New Text(sect, r.ReadToEnd())
text.IsHtmlTagSupported = True
text.IsFitToPage = True

sect.Paragraphs.Add(text)
p.Save(HttpContext.Current.Server.MapPath(“…/”) & “/test” & Date.Now.Hour & Date.Now.Minute & Date.Now.Second & “.pdf”)

Just a quick straightforward test as you could see.
Images are correctly displayed, However the CSS is almost completely ignored.

The isFitToPage method looks to be ignored too.

I’ve included the templatetest.html, styles.css and images and the generated PDF file in a ZIP file so you could reproduce the problem.
Could you have a look into these problems ?

Hi Jimmy,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the sample code.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34161. You will be notified via this forum thread regarding any updates against your issue.

Sorry for the inconvenience,