Python create pdf

matplotlib has a PDF backend to save figures to PDF. You can create a figures with subplots, where each subplot is one of your images. You have full freedom to mess with the figure: Adding titles, play with position, etc. Once your figure is done, save to PDF. Each call to savefig will create another The only pure-python package that I know off which will create PDF's for you is ReportLab, which have both a paid and free version. I have only used the free version, and it's a bit of a pain to work with – the pro version seems more promising. Once in a while as a data scientist, you may need to create PDF reports of your analyses. This seems somewhat “old school” nowadays, but here are a couple situations why you might want to consider. FPDF (format= 'letter') pdf. add_page pdf. set_font ("Arial", size= 12) pdf. cell (200, 10, txt= "Welcome to Python!", align= "C") pdf. output ("tutorial.pdf") Note that when we initialize our FPDF object we need to tell it that we want the result to be “letter”. This will create a string that we will eventually pass to our PDF creation engine. html_out = template . render ( template_vars ) For the sake of brevity, I won’t show the full HTML but you should I suggest Pdfkit. It creates pdf from html files. I chose it to create pdf in 2 steps from my Python Pyramid stack: Rendering server-side with mako templates with the style and markup To create static images of graphs on-the-fly, use the plotly.plotly.image class. This class generates images by making a request to the Plotly image server. This class generates images by making a request to the Plotly image server.