HTML to PDF conversion using Cef - Failed to convert webpage

Hi,
We're trying to use syncfusion html to pdf conversion on an azure function app (windows) with no success. 

we're using Cef package `Syncfusion.HtmlToPdfConverter.Cef.Net.Windows` version 26.1.40


the error is very unclear 

Syncfusion.Pdf.PdfException: Failed to convert webpage
 ---> Syncfusion.Pdf.PdfException: Failed to convert webpage
 at Syncfusion.HtmlConverter.CefConverter.CefResult(Stream outputStream)
 at Syncfusion.HtmlConverter.CefConverter.ConvertToPdf(String url, PdfDocument& document)
 --- End of inner exception stack trace ---
 at Syncfusion.HtmlConverter.CefConverter.Convert(String url)
 at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String url)


we're following the exact example as in here https://help.syncfusion.com/document-processing/pdf/conversions/html-to-pdf/net/convert-html-to-pdf-in-azure-functions-windows

to just convert google.com with no luck 

the function app is a dotnet8 isolated, also the platform is set to 64 bit as suggested. 

can you please help with figuring out the issue? 


Thanks,

Haneen





1 Reply

AM Arumugam Muppidathi Syncfusion Team August 23, 2024 01:05 PM UTC

Hi Haneen,


Thank you for reaching out to Syncfusion support.

We have checked your issue on our end. Upon further analysis, we have downloaded Azure function application sample in the below UG documentation

UG: https://help.syncfusion.com/document-processing/pdf/conversions/html-to-pdf/net/convert-html-to-pdf-in-azure-functions-windows

And publishing the application into azure app function windows.  After published the application into azure app function windows, you need to get the function URL in Azure portal to get output as explained in the below attached video.

Unfortunately, the reported issue was not reproduced.  The HTML to PDF conversion is working fine on our end.  We have attached the demo video and published URL below for your reference.

 

Demo video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Recording_2024-08-23_16571979162035
Published URL: https://html-to-pdf-azure-functions20240823164549.azurewebsites.net/api/Function1?code=1VuxoBXq_jjx9FIBj_dgPkkC_MI24XCNnzUQ5funtL4IAzFuHyXUDw%3D%3D

Note: The published URL will be expired after 48 hours.

 

Please try the above solution and let us know the result.  If you are still facing any issue, we kindly request you to share the Azure function hosting plan, Modified sample with us to replicate the same issue on our end and provide a prompt solution.


Regards,
Arumugam M


Loader.
Up arrow icon