Hi Milen,
Thank you for your interest in Syncfusion Products.
Our Html Converter makes use of MSHTML(IE Rendering Engine) to convert HTML to Image and then the Image is converted to PDF. As Microsoft.mshtml.dll assembly is not present in Azure cloud this issue occurs. Please refer this assembly in your project and copy the assemblies to local to get this issue fixed.
<Reference Include="Microsoft.mshtml">
<Private>True</Private>
</Reference>
Thanks,
Karthikeyan.C
Hi Milen,
Thank you for your update.
1) I have attached a sample for converting HTML to PDF which we have tried in our Azure cloud.
2) The COM error occurs if the instances are not properly disposed, could you please make the following code changes and recycle the IIS / Application Pool and check once again?
1) Proceed the HTMLConversion within “using” statement.
2) Dispose the PdfDocument instance after conversion.
3) After making these code changes, recycle the IIS / Application Pool to dispose the existing instances.
Here is the code snippet:
using (HtmlConverter html = new HtmlConverter())
{
// Conversion goes here
}
// Save PDF document
doc.Save("Sample.pdf", Response, HttpReadType.Open);
doc.Close(true);
Please try these changes and let us know if it helped.
Thanks,
Karthikeyan.C
Hi Milen,
Thank you for your update, please let us know if you need further assistance.
Regards,
Karthikeyan.C
WebRole for converting HTML to PDF |
|
WebRole for converting HTML to PDF with Azure Project |
|
Console Sample for using WebRole |