问题
When I create my pdf using dompdf it generates it as default width and height. I want to set custom width and height of my created pdf. If it is not possible in dompdf then kindly suggest some other plugin for php.
回答1:
By default it's going to render on 'US Letter', you can change this by using:
$dompdf->set_paper(DEFAULT_PDF_PAPER_SIZE, 'portrait');
You can use 'letter', 'legal', 'A4', etc..
Nevertheless you can set your own size like this:
$customPaper = array(0,0,360,360);
$dompdf->set_paper($customPaper);
More info: https://github.com/dompdf/dompdf/wiki/Usage
来源:https://stackoverflow.com/questions/25376901/how-to-set-custom-width-and-height-of-pdf-using-dompdf