Skip to content

aws lambda

Serving Tenant-Branded, Login-Free Web Pages from a Lambda with Tokenized Access

A recipient needs to open a document you sent them. They have no account, and you do not want them to create one. The document is sensitive, for example a medical report, so it must be delivered in the sender's branding, it must reflect the current state of the case, and it must be revocable the moment something changes. A static link cannot do all three at once.

HTML-to-PDF rendering fails once multi-page layouts, dynamic content, and page numbers are involved. Puppeteer can generate PDFs out of HTML-templates with stable page numbers, but only when its header and footer templates are used correctly.

Following you will find a working approach for dynamic multi-page PDFs with clean page numbers using NodeJS Chromium Puppeteer's header and footer templates.