We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error converting to PDF on BindHTML

I am getting the following error when converting html to pdf…



Attempt by method ‘System.Xml.Xsl.XsltOld.XsltCompileContext+FuncExtension.Invoke(System.Xml.Xsl.XsltContext, System.Object[], System.Xml.XPath.XPathNavigator)’ to access method ‘Aspose.Pdf.HTML.ᛜ.DeEntitize(System.String)’ failed.



I tried just a simple HTML to rule out HTML problems…















Here’s my code…



Dim template As String = getFileAsString(PdfPartsPath & “ReleaseAuth.htm”)

Dim sb As New StringBuilder(template)

sb.Replace("[Date]", Now.ToShortDateString())

Dim bt As Byte() = System.Text.Encoding.UTF8.GetBytes(sb.ToString())

Dim ms As System.IO.MemoryStream = New System.IO.MemoryStream(bt)

pdf1.BindHTML(ms)



The error happens on the BindHTML.





Any ideas?

Hi,


Thanks for using our products.

Can you please share the source HTML so that we can test the scenario at our end. We apologize for this inconvenience.

Hi,

I can’t post my html here, I tried in the original post and it doesn’t show the tags. Any html fails. I tried the most basic - start and end html tags with start and end body tags inside and that fails. I already tried to eliminate bad html as the issue.

Thanks,
John

Hi John,


Thanks for your inquiry. I’ve managed to notice exception issue with BindHtml() method and logged as PDFNEWNET-35713 in our issue tracking system for further investigation and resolution. We will update you as soon as its resolved.

Meanwhile, Can you please use following inline approach to convert HTML to PDF? Hopefully it will serve the purpose.


Please feel free to contact us for any further assistance.

Best Regards,

Hi,


In order for us to test and investigate the issue in details, we would be requiring the source HTML. Furthermore, in case you are facing problem with some tags, you may indicate the HTML2PDF rendering engine to skip the problematic HTML tags and render them as simple text. For further information, please take a look over Supported HTML features