Added an option for callbacks after the pdf is generated