insert convert dataframe, add new page and save to pdf.
import pandas as pd from tabulate import tabulate def convertToPDF(Path, df): html = tabulate(df, headers=df.columns, tablefmt='html', showindex=False) pdf = '<html><head></head><body>' + html + '</body></html>' with open(Path + ".pdf", 'w') as f: f.write(pdf)