fix PDF generation