Free Support Forum - aspose.com

Html2pdf problem

I'm trying to convert a web page to a pdf file...actually I use your example:

Pdf pdf = new Pdf();

pdf.BindHTMLFromUrl(@"http://www.google.com/");

pdf.Save("D://Test_aspose.pdf");

and I get an exception on the BindHTMLFromUrl method:


error: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size

of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index)

at get_Item(Int32 index) at get_LocalName()\r\n at System.Xml.Xsl.XsltOld.Processor.CopyBeginEvent(XPathNavigator node, Boolean emptyflag)\r\n at System.Xml.Xsl.XsltOld.CopyNodeSetAction.Execute(Processor processor, ActionFrame frame)\r\n at System.Xml.Xsl.XsltOld.ActionFrame.Execute(Processor processor)\r\n at System.Xml.Xsl.XsltOld.Processor.Execute()\r\n at System.Xml.Xsl.XsltOld.Processor.Execute(Stream stream)\r\n at System.Xml.Xsl.XslTransform.Transform(XPathNavigator input, XsltArgumentList args, Stream output, XmlResolver resolver)\r\n at System.Xml.Xsl.XslTransform.Transform(IXPathNavigable input, XsltArgumentList args, Stream output, XmlResolver resolver)\r\n at ᓶ.ᶾ.Ꮐ(String எ, String Ꮑ)\r\n at Aspose.Pdf.Pdf.Ꮐ(String எ, String Ꮑ, ᎎ Ꮌ, Boolean Ꮍ, String Ꮎ)\r

at Aspose.Pdf.Pdf.BindHTMLFromUrl(String url, String method)\r\n at ConsoleApplication1.Program.Main(String[] args) in D:\\PROJECTS\\pdf\\ConsoleApplication1\\ConsoleApplication1\\Program.cs:line 30

I've tryed with ver. 2.9.5.0, 2.9.0.0 and 2.8.0.0

Please healp me, I must make it work asa fast as I can.

Thanks.

Thanks for considering Aspose.

We will check this out. A reply will be given ASAP.

The problem is caused by the HTML parser which can not parse the complex HTML page.

The HTML page of Google contains some HTML tags that our product doesn't support now.

And there is no problem for our product to support simple HTML pages.

OK. I tried with several web pages and I have succeded to transform some of them.

Anyway, we don't want to have such limitations concerning the html pages formatting, so we'll keep looking.

Thanks for your support.