Added pdf generation util function.