#!/usr/bin/env python3 # Minimal PDF creator using reportlab # Saves a single-page PDF with the text 'Hello' to /tmp/test.pdf from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4 output_path = '/tmp/test.pdf' c = canvas.Canvas(output_path, pagesize=A4) width, height = A4 c.setFont('Helvetica', 40) text = 'Hello' # Center text roughly text_width = c.stringWidth(text, 'Helvetica', 40) c.drawString((width - text_width) / 2, height / 2, text) c.showPage() c.save() print(f'Wrote PDF to {output_path}')