new pdf generation functions