Adding tests for pdf generation and fixing bug caused by incorrectly handling input file