Pdf generation and GUI