Add pages to PDF

Report a typo

Suppose you want to create a new pdf file and add a lot of cells. Let's organize the following lines!

Remember that first of all, you need a page. After that, you need to set a font before writing in the document.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                for i in range(5):
              
                pdf = FPDF(orientation="P", unit="mm", format="Letter")
              
                pdf.output("file.pdf")
              
                from fpdf import FPDF
              
                pdf.cell(w=0, h=20, txt=f"This is the line {i}", border=0, ln=1, align="L")
              
                pdf.set_font(family="times", style="I", size=10)
              
                pdf.add_page()
              
___

Create a free account to access the full topic