Fix PDF generation