


Build and test it locally using Postman.ġ) Create an AWS SAM sample project.

Add the template.hbs handlebar file which contains the required HTML/CSS.I'll be using puppeteer, chrome-aws-lambda and handlebars to achieve it.Įnd Goal: Generate a PDF using a pre-defined HTML/CSS design, upload it to an AWS S3 bucket and generate the download URL as the API response. The sheer lack of good documentation made me struggle to make it work for my architecture which consisted of AWS Lambda function written in Node.js and deployed to AWS through SAM Template.Īfter a lot of struggle, I could finally make it work which made me realise the importance of writing this blog so that it helps another fellow developer too. Initially, I thought - "Yeah that's nothing new, we can achieve this quickly!" But little did I know that AWS architecture would complicate it so much for me. I had a requirement where I needed to generate PDFs from backend Node.js code.
