use case
Automated invoice generation
Turn every sale into a signed, branded, archived PDF.
Invoicing pipelines break in ugly ways — unsigned PDFs, missing watermarks, oversized attachments that bounce off Gmail. SnapPDF handles the last mile.
Operations used
/merge
Combine invoice + terms + cover letter
/watermark
Stamp PAID / OVERDUE / VOID
/add-page-numbers
Legally required in some regions
/compress
Get under Gmail’s 25MB limit
/sign
Stamp CFO signature for receipts
/metadata
Embed invoice number, customer, date
Example workflow
- 01Stripe webhook → invoice.paidTrigger on payment success.
- 02Generate invoice bodyYour existing HTML→PDF pipeline or template engine.
- 03SnapPDF mergeCombine body + terms + receipt.
- 04SnapPDF watermarkStamp PAID across page 1.
- 05SnapPDF compressDrop to ~500KB.
- 06Email to customerVia Resend, SendGrid, or SES.
Code
// On invoice.paid webhook:
const body = await generateInvoicePdf(order);
const { pdf } = await snap.pdf.merge({ files: [body, termsPdf, receiptPdf] });
const stamped = await snap.pdf.watermark({
file: pdf, kind: 'text', text: 'PAID', position: 'diagonal', opacity: 0.2,
});
const small = await snap.pdf.compress({ file: stamped.pdf, level: 'high' });
await resend.emails.send({ to: order.email, attachments: [{ content: small.pdf }] });Best for
E-commerceSaaS billingFreelance operatorsAgencies