I've been using the PyFPDF library for a while now, and when I was looking at other programmers codes I encountered a method that looks like this: (mostly It was used to set the width of columns in a table)
from fpdf import FPDF
pdf = FPDF()
pdf.w
I checked what doest the pdf.w method returns and it gives me a float number equal to 210.0015555555555. I'm wondering what does this method do and what does the float number mean centimieters, millimeters, pixels or something else?
I've printed the value of pdf.w and can't figure out what does it mean.
As one of @Barmar's comments says, if you try to execute the following code, you obtain the width of the page (and not of the cell of a table) in the different unit of measure (mm, cm, inch, point):
The output of the execution of the previous code is:
For details see the documentation of the class FPDF.
The width of a column
To build a table by PyFPDF you have to add a cell or multi_cell one after the other and set the attibute
wof the cell or multi_cell when you construct these objects: