Rail Ticket
An intercity rail ticket and seat reservation as a ticket office prints it on security coupon stock: the journey in the ruled boxes of an international ticket, the reservation underneath, and an Aztec code for the gate and the conductor's handheld.
- Security stock. A tint graded from peach to mint - gold for first class - the operator's name tiled across it at an angle in pale microtext, and a guilloche rosette behind the code: three layers that a photocopy flattens.
- The ruled boxes. Date, departure, from, to, arrival and class in one strip; train, coach, seat and place in a second, as every international rail ticket lays them out.
- The stock number in red. The pre-printed coupon number at the top right, the price behind asterisks so it cannot be extended, and the issuing office and time at the foot.
- An Aztec code. The rail industry's symbology for tickets, carrying the operator, the coupon, the reservation and the fare in one string.
- Archival and accessible. It claims PDF/A-2a and PDF/UA-1.
Features used: PDF/A-2a, PDF/UA-1 conformance, watermarks, columns, SVG, barcodes (aztec), data binding, components
- Output
- Template
- Data
How it's built
The ticket is one component, rail-ticket, laid in the normal flow as a grid: the header, the strip of journey boxes,
then the passenger, the reservation boxes, the via, fare and price on the left and the Aztec code on the right. Every
ruled box is rail-ticket-field - a label over a value, in the journey, reservation or place size - placed with its
values as parameters:
{
"use": { "name": "rail-ticket-field", "params": { "label": "TRAIN", "value": "$data.train", "size": "reservation" } }
}
The coupon is drawn behind it in two watermarks: rail-ticket-stock, the tint with the operator's name tiled across it,
and rail-ticket-art, the bands, the roundel, the boxes, the rosette and the train. The stock takes the journey's class
and is printed gold for first class, the standard peach to mint for second:
{
"scope": "page",
"repeat": false,
"content": { "use": { "name": "rail-ticket-stock", "params": { "class": "$data.journey.class", "operatorName": "$data.operator.name" } } }
}
The tint is a style with a gradient fill, so any shape can take it:
"rtTint-2": { "fill": { "linearGradient": { "angle": 90, "stops": [
{ "offset": 0, "color": "#FBE3CC" }, { "offset": 0.55, "color": "#FBF1DC" }, { "offset": 1, "color": "#DDEFE3" } ] } } }
The rosette is three bands of the same curve, each turned a third of a petal, drawn as path elements in a hairline
stroke.
Rail Ticket Sheet
One weekend's tickets from one booking, printed on one Letter sheet: out by intercity, a regional day trip to the coast, and back in first class. Each is the ticket above bound to its own record.
- One component, three journeys.
rail-ticketis placed once per record of$data.tickets; the records share the passenger and the booking and differ in the date, the stations, the times, the train, the coach and seat or none, the fare, its conditions and the price. - The class on the stock. The return is first class, and its coupon is printed gold: the stock's tint is chosen by the record's class, as a first-class ticket is marked at a glance.
- The tile on each coupon. The operator's name is tiled inside each ticket's stock, not across the page, so the white between the tickets stays white.
- A line to cut along. The
cut-linecomponent runs edge to edge in the gap under each ticket.
- Output
- Template
- Data
How the sheet is built
Each ticket is one record of $data.tickets, a table row per record, its parameters read from the row's own $item:
{
"table": {
"style": "railSheet",
"widths": [1],
"source": "$data.tickets",
"rows": [[{
"style": "railSlot",
"columns": { "widths": [1], "rows": [[{ "use": { "name": "rail-ticket", "params": { "from": "$item.journey.from", "to": "$item.journey.to", "class": "$item.journey.class", "train": "$item.reservation.train", "seat": "$item.reservation.seat" } } }]] }
}]]
}
}
The cut line, one component placed in each gap from the page's top:
{
"use": { "name": "cut-line", "x": 0, "y": 252, "width": 576, "height": 10 }
}