Stage 2: Generate PDF file