CloudCode - Pdf library that allows for dynamic headers and footers?

Hi all,

Do any of you have experience of using a library in CloudCode that allows for adding text / images on a pdf?

Our use case is that we convert html to pdf using the JourneyApps PDF Reports. From here, we need a way to be able to dynamically add headers/footers. Ideally, it would be great if we could iterate through each page and add text/images based on coordinates. This is useful because we would also want to be able to have the ability to skip certain pages.

Hi @alex.dang,

Why not consider adding the headers and footers directly into the HTML before conversion? Manipulating PDFs post-conversion in CloudCode is a bit of a challenge due to system library dependencies that aren’t readily available there.

If you still want to go down the PDF manipulation route, you could technically convert the HTML to images and then use HTML canvas for image manipulation. However, this approach has its drawbacks. For one, you’ll lose the vector graphics and scalability features inherent to PDFs. Moreover, the file sizes would likely balloon, making it less practical for distribution or storage.

I’d highly recommend sticking with HTML manipulation for headers and footers, as it’s generally easier, more scalable.

I hope this helps.