Allow generate_pdf_template_object to take None for the file_object so it can be called without a file and return a StringIO object.