Code to generate piechart.pdf