Events

Boarding pass PDF generator

An airline boarding pass with route, flight details and barcode — issued one per passenger at check-in.

Issue a clean boarding pass PDF for every passenger at check-in. Pass the airline, route, flight, date, gate and seat, and PDFgen returns a polished boarding pass with a barcode-style strip — ready to email or print.

Generate one per passenger from a single template, so a full flight is just a loop of API calls.

Generate a Boarding Pass 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 boarding pass 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:16px;overflow:hidden;box-shadow:0 10px 30px rgba(0,0,0,0.12);\">\n <div style=\"background:#0ea5e9;color:#fff;padding:16px 24px;display:flex;justify-content:space-between;align-items:center;\">\n <span style=\"font-weight:800;font-size:16px;letter-spacing:1px;\">{{airline}}</span>\n <span style=\"font-size:11px;opacity:.85;letter-spacing:2px;\">BOARDING PASS</span>\n </div>\n <div style=\"background:#fff;padding:24px;\">\n <div style=\"display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;\">\n <div style=\"text-align:center;\"><p style=\"font-size:30px;font-weight:800;margin:0;color:#0c4a6e;\">{{from.code}}</p><p style=\"font-size:11px;color:#6b7280;margin:2px 0 0;\">{{from.city}}</p></div>\n <div style=\"flex:1;text-align:center;color:#0ea5e9;font-size:20px;\">&#9992;</div>\n <div style=\"text-align:center;\"><p style=\"font-size:30px;font-weight:800;margin:0;color:#0c4a6e;\">{{to.code}}</p><p style=\"font-size:11px;color:#6b7280;margin:2px 0 0;\">{{to.city}}</p></div>\n </div>\n <div style=\"display:flex;flex-wrap:wrap;gap:16px 26px;font-size:13px;\">\n <div><p style=\"font-size:10px;color:#9ca3af;margin:0;letter-spacing:1px;\">PASSENGER</p><p style=\"margin:2px 0 0;font-weight:700;\">{{passenger}}</p></div>\n <div><p style=\"font-size:10px;color:#9ca3af;margin:0;letter-spacing:1px;\">FLIGHT</p><p style=\"margin:2px 0 0;font-weight:700;\">{{flight}}</p></div>\n <div><p style=\"font-size:10px;color:#9ca3af;margin:0;letter-spacing:1px;\">DATE</p><p style=\"margin:2px 0 0;font-weight:700;\">{{formatDate date}}</p></div>\n <div><p style=\"font-size:10px;color:#9ca3af;margin:0;letter-spacing:1px;\">BOARDING</p><p style=\"margin:2px 0 0;font-weight:700;\">{{boarding}}</p></div>\n <div><p style=\"font-size:10px;color:#9ca3af;margin:0;letter-spacing:1px;\">GATE</p><p style=\"margin:2px 0 0;font-weight:700;\">{{gate}}</p></div>\n <div><p style=\"font-size:10px;color:#9ca3af;margin:0;letter-spacing:1px;\">SEAT</p><p style=\"margin:2px 0 0;font-weight:700;\">{{seat}}</p></div>\n </div>\n <div style=\"margin-top:22px;height:46px;background:repeating-linear-gradient(90deg,#111827 0 2px,#fff 2px 5px);border-radius:4px;\"></div>\n </div>\n </div>\n</div>",
"engine": "handlebars",
"format": "A5",
"data": {
"airline": "Skyline Air",
"from": {
"code": "SFO",
"city": "San Francisco"
},
"to": {
"code": "JFK",
"city": "New York"
},
"passenger": "Sam Reyes",
"flight": "SL 482",
"date": "2026-09-12",
"boarding": "7:30 AM",
"gate": "B12",
"seat": "14C"
}
}' --output boarding-pass.pdf

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

What you can build

  • Issuing boarding passes from a check-in or booking system
  • Generating printable backups for mobile passes
  • Demo / prototype travel apps that need realistic passes
  • Event "boarding pass" style tickets and invites

Frequently asked questions

Can I generate a pass per passenger?
Yes — pass each traveller’s flight and seat data and call the API once per pass for a personalised PDF.
Can I add a scannable barcode?
The template includes a barcode-style graphic; insert a real barcode/QR image and pass its value to make it scannable.
Can I change the airline branding?
Yes — the airline name, colours and layout are all editable in the template.

Related templates

Ship your boarding pass 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.