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\Debug\net6.0\runtimes\win-x64\native"
Not sure why this is happening. Please help!!
Thanks,
Shradha Chauhan
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.
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.
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.
Thanks,
Shradha Chauhan
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.
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
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.
Yellow color highlighted line is the place where error is thrown.
We have created a separate layer for the installed packages. Attached file here contains the list of all packages that we upload to AWS Lambda.
Please let us know the way to resolve this issue. It would be highly appreciable If you could create a sample similar to our case so that we could identify where we are doing wrong.
Thanks
Shradha Chauhan
Attachment: PackageLayerInstallation_62b90ca6.zip
We have checked the reported issue and the HTML to PDF conversion works fine with AWS lambda function in the latest version 21.1.41 on our end. We can perform the conversion in AWS lambda without setting the blink path In latest version. We have ensured the conversion in AWS lambda function with default path on our end . We have attached the sample link below for your reference,
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/HTML_to_PDF_Lambda-1464021243
Note: We have changed the NuGet package structure for BlinkBinariesAWS to runtimes folder From v21.1.XX (i.e runtimes\linux\native).
Kindly try the provided sample on your end and let us know the result
Hi,
Thanks for providing the solution. We are successfully able to generate the PDF using a c# client. Can you please guide us how do we call the lambda function using Angular 15.
Regards
~Vikas
Currently we are checking on this and will update the further details on May 30th,2023
Currently we are creating the sample for your requirement and will update the further details on May 31st,2023
We are facing the complexities to create the Angular sample to call the lambda function. We will update the further details on June 2nd, 2023.
we are facing issue with aws-sdk in angular application, kindly try below code in your side and let us know the result.
const AWS = require('aws-sdk')
lambda.invoke(params, (err: Error, data: any) => {
|