It's easy to figure out how to convert html into an image/pdf on an express server using libraries like html-pdf. But, I've been struggling for weeks trying to figure out how to take my locally-working code working in an AWS Lambda. The problem is, the library I'm using requires phantomjs to run, and it's very difficult to get phantomjs running in AWS lambda. You can see what I've tried here: How do you install phantomjs on AWS lambda?
This question isn't necessarily about that struggle. This question is higher level. I'm looking for some code that takes HTML and converts it to a PDF or image. This code doesn't have to use html-pdf or phantomjs. I'm looking for any working example that converts html to pdf/image and works in a lambda. It does not have to visit a webpage. I have the HTML in a string variable.
I'm looking for an answer that uses nodejs.