Search code examples
phppdf-generationcellfpdf

Why are there unexpected spaces on my PDF using FPDF with PHP?


I'm using FPDF to write some text on a PDF. I'm displaying 8 different cells of text. The Cells are being displayed, but after two cells, it puts the next cell onto a new page as If I had asked for a new PDF page to be made, but I did not. I'm guessing it is somehow pushing them down and pushing it onto the next page. How can I get rid of these annoying spaces and make it all fit on only the one PDF page?

I am using the FPDF Class - http://fpdf.org/en/doc/index.php


Solution

  • look at

    SetAutoPageBreak(boolean auto [, float margin])

    Description Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.