Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 865 Bytes

README.md

File metadata and controls

37 lines (29 loc) · 865 Bytes

lambda-wkhtmltopdf

Convert HTML to PDF using wkhtmltopdf on AWS Lambda

Input

{
    "data" : "<h1>Claudemiro</h1>",
    "filename": "optional filename",
    "pagesize": "optional pagesize default: a4",
    "bucket": "s3 bucket to use for output"
}

Output

{
    "filename": "8rqj9td0pvjf9a4i.pdf"
}

Configuration

  1. Make sure AWS Lambda function has PutObject access to S3 bucket
  2. Download the binary wkhtmltopdf for linux-x64 and put in the current directory
  3. Run npm install
  4. Zip everything and upload to aws-lambda

Links