We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ConvertToImage error

I am trying to create a PDF by using the HTML image solution. This works for a while, and then sometimes it will randomly throw an "HRESULT E_FAIL" error message, and it won't work again until I re-upload the DLL.

Any suggestions?


This is the error message:

Error HRESULT E_FAIL has been returned from a call to a COM component.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.



Here is my code:

// Convert the HTML to an image
System.Drawing.Image htmlImage = html.ConvertToImage("URL", ImageType.Metafile, 800, -1);



3 Replies

BP Bhuvaneswari P Syncfusion Team December 10, 2008 11:06 AM UTC

Hi AdamR,

Thank you for your interest in Syncfusion products.

Could you please drag and drop the interop dlls [AxSHDocVw.dll and SHDocVw.dll ]to the GAC[C:\windows\assembly] and try to run the application and let us know if this helps you to resolve exception issue.

Best Regards,
Bhuvana




AD Administrator Syncfusion Team December 18, 2008 08:31 PM UTC

Hi Bhuvana,

Thanks for your support. I'm still getting the error after moving those files into the specified directory.

The error is occurring on a daily basis now. Even if I re-upload the DLLs to the \bin directory, I still get the error. I have a try{} catch{} around my code block that attempts to create the PDF, but I would really like this to be a consistent component.

Any other suggestions I might try?



BP Bhuvaneswari P Syncfusion Team December 19, 2008 04:34 AM UTC

Hi AdamR,

Thanks for the update.

We have provided article for HTML to PDF conversion. There we mentioned some solution for these kind of issues. Please have a look into the article and try using and let us know if this helps you.
http://www.syncfusion.com/products/PDF/Backoffice/Articles/html_to_pdf.aspx

Best Regards,
Bhuvana


Loader.
Live Chat Icon For mobile
Up arrow icon