Hi
I'm trying to run the HTML to PDF converter on Azure (Azure Function App running Isolated on Linux, running on consumption plan).
I added this code to copy chrome to temp folder (as provided here: https://support.syncfusion.com/kb/article/8975/how-to-convert-html-to-pdf-in-azure-functions-40-with-aspnet-core-pdf?isInternalRefresh=False )
The error I get now is this: "Failed to launch chromium: Missing required dependent packages."
Am I forgetting something?
Thanks in advance!
Hi Tijs,
Thank you for reaching out to Syncfusion support.
We have checked your issue on our end. Upon further analysis, we have created a sample application to replicate the reported issue in performing HTML to PDF conversion in Azure Function App (Linux). Unfortunately, the reported issue was not reproduced and the conversion is working fine on our end. However, we have attached the sample and published URL below for your reference
Sample: HTML_to_PDF_Azure_functions821878675
Please try the above sample and let us know the result. If you are still facing any issue, we kindly request you to share the modified sample, complete code snippet, package name and version, .NET version with us. This information will be more helpful for us to analyze and provide you with a prompt solution.
Regards,
Arumugam M
Hi Arumugam
Thank you for your response. Unfortunately I still experience the same issue.
When I use the blinkAppDir from the provide SetupBlinkBinaries (as in the published sample) I do get the following exception: "Blink files are missing at /tmp/"
When I change the blinkAppDir to this:
var blinkAppDir = $"{Environment.GetEnvironmentVariable("HOME")}/site/wwwroot/runtimes/linux/native";
then I get "Failed to launch chromium: Missing required dependent packages."
Note that the function is running from a dependency project.
This is the package that I'm using:
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Net.Linux" Version="27.1.57" />
My project is running on .NET 8 and is deployed to a flex consumption plan azure function running on Linux.
Hi Tijs,
We have checked the reported issue on our end. Upon further analysis, we kindly request you to follow the below solution approaches while performing HTML to PDF in Azure Function App (Linux). This ensures that the HTML to PDF conversion in Azure Function App (Linux) is working without any exception.
chmod +rwx chrome-wrapper chmod +rwx chrome |
2. Kindly ensure the chrome required dependency packages are installed or not using the below command in "runtimes/linux/native" location.
ldd chrome |
Please try the above solution and let us know the result. Kindly get back to us if you need any further assistance in this.
Regards,
Arumugam M
Hi Arumugam
Thank you for your help.
The function app is running on a flex consumption plan. Therefor I don't have access to any console and I can't run the above commands on the function app. Is there another way I can achieve this?
Thanks in advance!
Update: my Functions were running on the new 'Flex Consumption' plan.
I created a new azure function on the regular 'Consumption' plan and sure enough it works now.
Seems like the dependencies are installed correctly on the 'consumption' plan, but not on the 'Flex consumption' plan.
Is there anything else I need to do in order to make it work on the flex consumption plan? Or is it not supported?
Thanks in advance!
Hi Tijs,
Thanks for the update. We are glad to hear that the reported issue has been resolved on performing HTML to PDF conversion in Azure Function App (Linux) with Consumption plan. Currently, we are checking the possibilities to perform HTML to PDF conversion in Azure Function App with Flex consumption plan to overcome the issue. We will update further details on November 19th 2024.
Regards,
Arumugam M
Hi Tjis,
Upon further analysis, There is no SSH prompt or any console in Azure Flex Consumption plan to install dependencies during HTML to PDF conversion in Azure Function App. Those dependencies are required to perform HTML to PDF conversion in Azure Function. However, we can achieve this by using the Consumption Plan in Azure Function App to perform HTML to PDF conversion.
Regards,
Arumugam M