Using empty text cells to place other text cells

# Import FPDF class
from fpdf import FPDF

# Create instance of FPDF class
# Letter size paper, use inches as unit of measure
pdf=FPDF(format='letter', unit='in')

# Add new page. Without this you cannot create the document.

# Remember to always put one of these at least once.

# Text in cell 2.5 inches wide, automatic height (0.0)
# starting at left margin
pdf.cell(2.5,0.0,'Hello World!')

# Remember this? 0.25 inches line break

# Move 1.0 inch to the right
# Now write text in cell 2.5 inches wide, 0.15 in height.
# Notice we did not put any line break, so this text should follow
# immediately. Will leave borders to emphasize the cell concept.
pdf.cell(2.5,0.15,'Hello World!', border=1)
# Keep in the same line and write again.
pdf.cell(2.5,0.15,'Hello World Again!', border=1)

# Now a line break

# output content into a file ('F') named 'hello7.pdf'



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s