I'm using AWS Lambda to generate pdf file using a ninja2 template. I am trying to use pdfkit to convert my HTML into pdf. I realize pdfkit has an internal dependency - wkhtmltopdf which needs to be used as a binary or installed via a package manager. I am not sure how to make this work on AWS Lambda?
With my current template and python code using pdfkit, I am getting the following error -
{
"errorMessage": "No wkhtmltopdf executable found: \"b''\"\nIf this file exists please check that this process can read it. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf",
"errorType": "OSError",
.....
.....
}
Any ideas on how can I make pdfkit work on lambda?
Any suggestions for wkhtmltopdf replacements?
Thanks
I've made a simple demo on using PDFKit using Serverless framework using layer. Checkout https://medium.com/@crespo.wang/create-pdf-using-pdfkit-on-serverless-aws-lambda-with-layer-721ca86724b2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With