pdf generation script