I've taken a dive into FPDF lately and something that i don't seem to understand is - why is there no way to set a bottom margin? There are functions for setting margins from the top, left and right, but not from the bottom.
I assume now that i misunderstand something basic and conceptual about how FPDF works yet i got no clue on what that could possibly be.
So to cut it down:
Is it possible to define a fixed bottom margin in FPDF?
$fpdf->SetAutoPageBreak(false); Just make sure that you're manually breaking pages where appropriate for your PDF.
php require('fpdf. php'); $pdf = new FPDF('P','mm','A5'); $pdf->AddPage('P'); $pdf->SetDisplayMode(real,'default'); $pdf->SetFont('Arial','',10); $txt = file_get_contents('comments. txt', true); $pdf->Write(8, $txt); $pdf->Output(); ?>
I just found the solution - the bottom margin is simply left out of predefinition because it is part of the page break calculation process. Therefore, setting a bottom margin in itself is not possible, but it can be done using
SetAutoPageBreak(boolean auto, [float margin])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With