Deej
Deej

Reputation: 105

DOMPDF Stuck on Letter Paper Size

I'm using DOMPDF on a little web app I'm building. It's working great apart from it's stuck on the default paper size of 'US Letter' no matter where I change it.

Any ideas?

// dompdf_config.inc.php
def("DOMPDF_DEFAULT_PAPER_SIZE", "a4");

Upvotes: 3

Views: 37903

Answers (2)

zzapper
zzapper

Reputation: 5041

The above did not help me still stuck on Letter The following did work (from DOMPDF FAQ)

$dompdf->set_paper("A4", "portrait");

Upvotes: 8

Tom Metcalfe
Tom Metcalfe

Reputation: 308

Are you correctly calling the 'set_paper' method in your pdf creation as follows :

$dompdf->set_paper(DEFAULT_PDF_PAPER_SIZE, 'portrait');

Furthermore, you can define your own paper size if this is still not working using something along the lines of the following :

$paper_size = array(0,0,360,360);
$dompdf->set_paper($paper_size);

Upvotes: 10

Related Questions