pdf generation and printing