Events

Event ticket PDF generator

A branded admission ticket with seat and order details — generate one per attendee instantly.

Create a branded admission ticket for every attendee as soon as they register. Pass the event, date, venue, attendee and seat, and PDFgen returns a polished ticket PDF with a perforated-stub look — ready to email or add to a wallet flow.

Generate one ticket per order in a loop, all from a single reusable template, so a sold-out show is just one API call per buyer.

Generate a Event Ticket 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 event ticket 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:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;color:#111827;\">\n <div style=\"display:flex;border-radius:16px;overflow:hidden;box-shadow:0 10px 30px rgba(0,0,0,0.12);max-width:560px;margin:0 auto;\">\n <div style=\"background:#4f46e5;color:#fff;padding:32px;flex:1;\">\n <p style=\"font-size:12px;letter-spacing:2px;text-transform:uppercase;opacity:.8;margin:0;\">{{category}}</p>\n <h1 style=\"font-size:26px;font-weight:800;margin:10px 0 0;line-height:1.2;\">{{event}}</h1>\n <p style=\"margin:18px 0 0;font-size:14px;opacity:.9;\">{{formatDate date}} &middot; {{time}}</p>\n <p style=\"margin:4px 0 0;font-size:14px;opacity:.9;\">{{venue}}</p>\n <div style=\"margin-top:24px;display:flex;gap:28px;\">\n <div><p style=\"font-size:11px;opacity:.7;margin:0;\">ATTENDEE</p><p style=\"font-size:15px;font-weight:700;margin:2px 0 0;\">{{attendee}}</p></div>\n <div><p style=\"font-size:11px;opacity:.7;margin:0;\">SEAT</p><p style=\"font-size:15px;font-weight:700;margin:2px 0 0;\">{{seat}}</p></div>\n </div>\n </div>\n <div style=\"background:#312e81;color:#fff;padding:32px 24px;text-align:center;border-left:3px dashed rgba(255,255,255,.4);display:flex;flex-direction:column;justify-content:center;\">\n <p style=\"font-size:11px;opacity:.7;margin:0;\">ADMIT ONE</p>\n <p style=\"font-size:13px;font-weight:700;margin:8px 0;letter-spacing:1px;\">{{orderNumber}}</p>\n <div style=\"width:70px;height:70px;background:repeating-linear-gradient(90deg,#fff 0 3px,#312e81 3px 6px);margin:8px auto 0;\"></div>\n </div>\n </div>\n</div>",
"engine": "handlebars",
"format": "A5",
"data": {
"category": "Live Music",
"event": "Midnight Echo — World Tour",
"date": "2026-09-12",
"time": "8:00 PM",
"venue": "The Fillmore, San Francisco",
"attendee": "Sam Reyes",
"seat": "GA-204",
"orderNumber": "TKT-77station"
}
}' --output event-ticket.pdf

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

What you can build

  • Emailing a ticket PDF immediately after checkout
  • Bulk-generating tickets for an event’s full attendee list
  • Producing seat-specific tickets for assigned seating
  • Adding printable backups to a mobile ticketing flow

Frequently asked questions

Can I generate a unique ticket per attendee?
Yes — pass each attendee’s name, seat and order number and call the API once per ticket. Every render is personalised.
Can I include a barcode or QR code?
The template ships with a barcode-style stub. To encode a real scannable code, drop an image URL or an inline SVG/QR into the template and pass the value in your data.
What paper size are tickets?
This template renders at A5 by default; pass a different format value to change it.

Related templates

Ship your event ticket 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.