i ran into an issue with fpdf python library for pdf generation. Turns out I need my pdf with dimensions [2 inches width x 1 inches height] because i need it to print a small label in zebra printer.
The following operations were executed:
I need the cells to be the height i want (in this case 0.1), because the data i am placing comes from a database and also there are at least 3 rows which i need to insert one below other.
NOTES: When increasing pdf height [2 inches width x 2 inches height] instead of [2 inches width x 1 inches height], it behaves as I expected, but i need the [2 inches width x 1 inches height] dimensions.
I am using:
Thanks to Olivier's comment i could resolve the issue by disabling automatic page break. In my code it looks like this:
page_size = (2, 1)
#Set page size to 2inch-width x 1inch-height
pdf = FPDF("P", "in", page_size)
pdf.add_page()
pdf.set_auto_page_break(auto=False)