Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
5 views1 page

HTML Viewer

Uploaded by

mdmunnakhan547
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

HTML Viewer

Uploaded by

mdmunnakhan547
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

from reportlab.lib.pagesizes import A4 from reportlab.

lib import colors from


reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle
from reportlab.lib.styles import getSampleStyleSheet # File path file_path =
"/mnt/data/Malaysia_Airlines_E_Ticket.pdf" # Document setup doc =
SimpleDocTemplate(file_path, pagesize=A4, title="Malaysia Airlines E-Ticket")
styles = getSampleStyleSheet() styleN = styles["Normal"] styleH =
styles["Heading1"] styleB = styles["Heading2"] # Story content story = [] # Add
Malaysia Airlines logo placeholder (header) story.append(Paragraph("✈️ Malaysia
Airlines – E-Ticket Itinerary & Receipt", styleH)) story.append(Spacer(1, 12)) #
Booking Info story.append(Paragraph("📌 Booking Information", styleB)) booking_info
= [ ["Booking Code (PNR):", "E8SHM3"], ["Airline:", "Malaysia Airlines"], ["Ticket
Type:", "Economy Lite"], ["Flight:", "MH103 (Direct)"] ] table =
Table(booking_info, colWidths=[180, 300]) table.setStyle(TableStyle([("BOX", (0,
0), (-1, -1), 1, colors.black), ("INNERGRID", (0, 0), (-1, -1), 0.5, colors.black),
("BACKGROUND", (0, 0), (0, -1), colors.lightgrey)])) story.append(table)
story.append(Spacer(1, 12)) # Passenger Info story.append(Paragraph("👤 Passenger
Details", styleB)) passenger_info = [ ["Name", "Passport No.", "Nationality", "Date
of Birth", "Gender"], ["MD MARUF HASAN", "A14381298", "Bangladeshi", "01 July
1976", "Male"] ] table = Table(passenger_info, colWidths=[120, 120, 120, 120, 80])
table.setStyle(TableStyle([("BOX", (0, 0), (-1, -1), 1, colors.black),
("INNERGRID", (0, 0), (-1, -1), 0.5, colors.black), ("BACKGROUND", (0, 0), (-1, 0),
colors.lightblue)])) story.append(table) story.append(Spacer(1, 12)) # Flight Info
story.append(Paragraph("🛫 Flight Details", styleB)) flight_info = [ ["Date", "From
(Airport)", "Departure", "To (Airport)", "Arrival", "Duration"], ["26 Sep 2025",
"Dhaka (DAC) – Hazrat Shahjalal Intl. Airport", "12:15", "Kuala Lumpur (KUL) –
Intl. Airport (Terminal 1)", "18:15", "4h 00m"] ] table = Table(flight_info,
colWidths=[70, 150, 60, 150, 60, 60]) table.setStyle(TableStyle([("BOX", (0, 0), (-
1, -1), 1, colors.black), ("INNERGRID", (0, 0), (-1, -1), 0.5, colors.black),
("BACKGROUND", (0, 0), (-1, 0), colors.lightblue)])) story.append(table)
story.append(Spacer(1, 12)) # Baggage & Services story.append(Paragraph("🛄 Baggage
& Services", styleB)) services_info = [ ["Cabin Baggage:", "7 kg"], ["Checked
Baggage:", "20 kg"], ["Meals & Beverages:", "Included"], ["Refundable:", "Yes"],
["Reschedule:", "Allowed"] ] table = Table(services_info, colWidths=[180, 300])
table.setStyle(TableStyle([("BOX", (0, 0), (-1, -1), 1, colors.black),
("INNERGRID", (0, 0), (-1, -1), 0.5, colors.black), ("BACKGROUND", (0, 0), (0, -1),
colors.lightgrey)])) story.append(table) story.append(Spacer(1, 20)) # Footer note
story.append(Paragraph("✅ This is your confirmed e-ticket. Please carry your
passport and a printed or digital copy of this e-ticket for check-in.", styleN)) #
Build PDF doc.build(story) file_path

You might also like