Free Support Forum - aspose.com

Converting streamed HTML to PDF

HI we are currently trying to stream some html from an external source and converting it to PDF.



Using the code here http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/how-to-convert-html-to-pdf-using-inlinehtml-approach.html (the wikepedia entry), we are trying to set pdf.HtmlInfo.ImgUrl = “http://en.wikipedia.org/”; causes the code to fail with the error ‘URI formats are not supported.’ We cannot serve the images off the file system, so these need to be referenced by URL.



Is there a workaround to convert streamed HTML to a PDF using URL base paths?





BindHTML(

string html,

string basePath

); seems to require a file path as well.



Thanks

Hi,

Thanks for your interest in our products.

I have tested the scenario with upcoming release version of Aspose.Pdf for .NET 6.2.0 (which is expected to be release in a day or two) and I am unable to notice any problem. Can you please wait for sometime and try using the upcoming release ? In case you still face any issue with the new version, please feel free to contact. We apologize for your inconvenience.

HI



Thanks for this, could you confirm you’re running the code from the example above and have uncommented the line -



pdf.HtmlInfo.ImgUrl = “http://en.wikipedia.org/



Many Thanks



Dave

Hello Dave,

I have tested the scenario and have uncommitted the ImgUrl code line and as per my observations, the PDF document is properly being generated. Please note that HTML to PDF conversion might not produce 100 percent identical results as HTML to PDF conversion is getting mature. As soon as the new version becomes available, please try using our product and in case you observe any issue or you have any further query, please feel free to contact.