fixes to pdf generation
fixes to pdf generation