pdf generation almost done