Marketing

Postcard PDF generator

A bright travel/marketing postcard with a message and address block — perfect for mailers at scale.

Produce print-ready postcards for direct mail or marketing campaigns without a designer. Pass the destination, message and recipient address, and PDFgen renders a bright, personalised postcard PDF.

Generate one per recipient in a loop, so a mailing list of thousands becomes thousands of personalised postcards from a single template.

Generate a Postcard PDF via the API

POST your data to /api/v1/generate and get a PDF back. Copy-paste an example, swap in your API key, and loop over a list to render thousands — one postcard per record.

curl -X POST https://pdfgen.com/api/v1/generate \
-H "Authorization: Bearer pdfg_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"html": "<div style=\"padding:28px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#111827;\">\n <div style=\"max-width:560px;margin:0 auto;border-radius:14px;overflow:hidden;box-shadow:0 12px 32px rgba(0,0,0,.15);\">\n <div style=\"height:200px;background:linear-gradient(135deg,#f59e0b,#ef4444);position:relative;\">\n <div style=\"position:absolute;bottom:18px;left:24px;color:#fff;\">\n <p style=\"font-size:13px;letter-spacing:3px;text-transform:uppercase;margin:0;opacity:.9;\">Greetings from</p>\n <h1 style=\"font-size:38px;font-weight:800;margin:4px 0 0;text-shadow:0 2px 8px rgba(0,0,0,.25);\">{{destination}}</h1>\n </div>\n </div>\n <div style=\"background:#fff;padding:24px;display:flex;gap:20px;\">\n <div style=\"flex:1;font-size:14px;color:#374151;line-height:1.6;font-family:Georgia,serif;\">{{message}}</div>\n <div style=\"width:160px;font-size:12px;color:#6b7280;border-left:1px solid #e5e7eb;padding-left:16px;\">\n <div style=\"width:46px;height:54px;border:2px solid #e5e7eb;border-radius:4px;margin:0 0 12px auto;\"></div>\n <p style=\"margin:0;font-weight:600;color:#111827;\">{{to.name}}</p>\n <p style=\"margin:4px 0 0;white-space:pre-line;\">{{to.address}}</p>\n </div>\n </div>\n </div>\n</div>",
"engine": "handlebars",
"format": "A5",
"data": {
"destination": "Lisbon",
"message": "Having an amazing time exploring the old town and tasting all the pastéis de nata. Wish you were here — see you soon!",
"to": {
"name": "Alex Carter",
"address": "742 Evergreen Terrace\nPortland, OR 97201"
}
}
}' --output postcard.pdf

Working in another language? Follow a full guide for your stack:

What you can build

  • Personalised direct-mail campaigns at scale
  • Travel or event "greetings from" postcards
  • Loyalty or win-back mailers per customer segment
  • Print-on-demand postcard fulfilment

Frequently asked questions

Can I personalise each postcard?
Yes — pass the message and recipient details per record and call the API once per postcard for a fully personalised mailer.
Is it print-ready for a mail house?
It renders a clean PDF you can hand to a print/mail provider; adjust the size and bleed in the template to match their spec.
Can I swap the cover image?
Yes — replace the gradient header with your own image URL in the template and pass per-postcard values in your data.

Related templates

Ship your postcard PDF endpoint today

Generate this template with AI, tweak it to match your brand, then render at scale with a single API call — no headless browsers to babysit.