I’m creating PDF files with PHP using TCPDF. I have a small problem with created PDF files.
I would like to set up right and left margin of each PDF file created. Currently if there is 10px margin on the left side, there is 20px margin on the right side.
How do I set up right and left page margin?
Thank you all for your time and concern.
I tried following;
$pdf->SetMargins(10, 10, -50, true); and $pdf->SetRightMargin(-50); without any luck.
In the new documentation it shows the function as
TCPDF::SetMargins($left,$top,$right = -1,$keepmargins = false)And describes the parameters as:
So, for the right margin a
-1is used to indicate that no right margin was supplied and to use the same as the left margin. You were using-50which is not a valid margin.Try this instead: