Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customized width and height in DOMPDF

Tags:

php

dompdf

Is there anyway i can set the generated PDF's width and height? i want to customized the width and height of the PDF. Normally it would be on a size of a short bond paper but how can i customized it? lets say for example i want it to be 200 x 500 pixel in size?

Any idea would be very much appreciated! cheers!

like image 262
unknown Avatar asked Jan 12 '12 12:01

unknown


1 Answers

You can set your own format, without having to change DOMPDF code, by passing an array when you're calling DOMPDF::set_paper(). Make sure it contains the width and the height in points, like this:

$dompdf->set_paper(array(0, 0, 595, 841), 'portrait');

like image 173
Michiel Avatar answered Sep 24 '22 05:09

Michiel