fix pep8 on to_pdf