Working pdf generation(unfinished)