Can I use wkhtmltopdf on AWS Lambda

Include the wkhtmltopdf binary and making sure it has execution permission(chmod 755). Add the binary path to your language runtime. e.g. with nodejs

process.env['PATH'] = process.env['PATH'] + ':' + process.env['LAMBDA_TASK_ROOT'] + '/bin/linux';

There are multiple projects on GitHub claiming to run wkhtmltopdf on Lambda. Here are a few.

  • https://github.com/lubos/aws-lambda-wkhtmltopdf
  • https://github.com/dimiro1/lambda-wkhtmltopdf
  • https://github.com/jpaolin/aws-lambda-s3-wkhtmltopdf