Correctly generate the pdf