how to set margins

2,028 views
Skip to first unread message

rodri...@gmail.com

unread,
Feb 24, 2011, 11:20:12 AM2/24/11
to dompdf
How to set margins in dompdf
Hi everyone, I am using dompdf 0.6 beta 2, and i trying to wrap all
the report with margins.
I have this
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("ticket de solicitud.pdf");

But I want to set margins to render everything, for example 4cm top …
3 bottom … 3 left… 3 right.
I am new with dompdf and I really appreciate if anyone can help me.
Thanks

BrianS

unread,
Feb 25, 2011, 1:34:02 PM2/25/11
to dom...@googlegroups.com
You should be able to do this by styling the body margin/padding:

body { margin: 4cm 3cm 3cm 3cm }
Reply all
Reply to author
Forward
0 new messages