[QAE1032] PDF generation: refactoring