Improve PDF printing; separate out helper classes