go-wkhtmltopdf-lambda

command module
v0.0.0-...-83a577b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-wkhtmltopdf-lambda

Run wkhtmltopdf in AWS Lambda

Not maintained for now, but mainly an example of how to use go-wkhtmltopdf on Lambda.

Uses https://github.com/SebastiaanKlippert/go-wkhtmltopdf to generate PDF files from JSON input.

Usage

  • Create a Golang AWS Lambda function in the AWS console or using the AWS CLI
  • As source, use the lambda.zip file from a release, this includes the latest version of wkhtmltopdf
  • The Handler name is go_wkhtmltopdf_linux
  • If you want to build your own version, make sure you build the go executable for Linux (GOOS=linux) and make it executable (chmod +x)
  • Create an S3 trigger for you Lambda function (using suffix .json is recommended)
  • Make sure your IAM Lambda role has S3 Read and Write access to your bucket
  • Create a JSON file from the PDF generator, following the instructions at https://github.com/SebastiaanKlippert/go-wkhtmltopdf#saving-to-and-loading-from-json
  • Upload the JSON to the S3 bucket you chose in your Lambda trigger
  • The PDF is saved in the same bucket with extension .pdf added to the original filename

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL