[WORKAROUND] Adjust code for PDF generation