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

PDF is not getting generated out of HTML when published the API on AWS Lambda

Hi Team,

We are using Syncfusion HTML to PDF and "Syncfusion.HtmlToPdfConverter.Net.Windows" package in our .NET Core 6 application. The PDF is getting generated totally fine on my local machine but fails once the API is published to AWS Lambda and throws the following error:

"Blink files are missing at C:\VS2022_workspaces\cicadagreen.visualstudio.com\Redi4\Redi4_Serverless_Api\bin\Debuget6.0\runtimes\win-x64ative"

Not sure why this is happening. Please help!!

Thanks,

Shradha Chauhan


12 Replies

SN Santhiya Narayanan Syncfusion Team April 11, 2023 10:10 AM UTC

We have a separate package named as “Syncfusion.HtmlToPdfConverter.Net.Aws” for perform HTML to PDF conversion in AWS lamda. We need to install this package to perform HTML to PDF conversion in AWS. We have attached the sample with latest Syncfusion AWS package for your reference,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/AWSLambdaNet61651249268

For Binaries missing exception,

 1.Copy the BlinkBinariesAWS folder in parallel to the csproj file and select the “copy if newer” in binary files copy to output directory property.

image

 

2.We need to set the Blink binaries path in Function.cs file using BlinkConverterSettings class.

blinkConverterSettings.BlinkPath =  "BlinkBinariesAWS";

 

Note: From next weekly release we do not need to set the Blink binaries path and do not need to copy the binaries folder in parallel to the project.

Please refer the below UG documentation for more information,
UG: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/aws

 Kindly publish the provided sample on your end and let us know the result.




SH Shradha April 13, 2023 09:39 AM UTC

Hi Team,

Thanks for your immediate response. We followed the same steps in our project but again getting error. Following is the stack trace of the error:

"Syncfusion.Pdf.PdfException: Blink files are missing at /var/task/BlinkBinariesAws at Syncfusion.HtmlConverter.BlinkConverter.Convert(String url) at Syncfusion.HtmlConverter.BlinkConverter.Convert(String htmlString, String baseurl) at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String html, String baseurl) at Redi4_Serverless_Api.Controllers.GetHtmlForEopsController.FnConvertHtmlToPdf(Int32 eopId, String clientName)"

We installed " Syncfusion.HtmlToPdfConverter.Net.Aws" package and copied the "BlinkBinariesAWS" folder to our project and also updated the Copy to Output Directory property of all three files inside "BlinkBinariesAWS" folder. Following attached are the images for your reference of our implementation. Please let us know what gone wrong in our implementation.

package.png

blinkFolder.png

code.png

Thanks,

Shradha Chauhan



SN Santhiya Narayanan Syncfusion Team April 14, 2023 01:12 PM UTC

We were able to reproduce the reported issue with provided details on our end. Currently, we are analysing on this and will update the further details on April 18th 2023.



SN Santhiya Narayanan Syncfusion Team April 19, 2023 09:09 AM UTC

We have included the fix for this issue “Blink binaries are missing for html converter” in our latest weekly release (21.1.41).

Please use the below link to download our latest weekly NuGet,

NuGet Link: https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.Net.Aws/21.1.41



SH Shradha April 19, 2023 02:32 PM UTC

Hi Team,

Thank you so much Syncfusion Team for your quick response to our queries and we really appreciate your hard work.

We installed the latest version of "Syncfusion.HtmlToPdfConverter.Net.Aws" ​(21.1.41) and then published our API on AWS Lambda. Following mentioned is the error that was logged in our database-

Failed to extract the tar.br files Could not find file '/opt/dotnetcore/store/x64/net6.0/syncfusion.htmltopdfconverter.net.aws/21.1.41/lib/netstandard2.1/aws.tar.br'.

Following image shows the error that we received in our controller when put a breakpoint there.