Search code examples
phphtml2pdf

How to change PDF format from A4 to Us Letter using html2pdf?


I'm trying to change PDF format from A4 to US LETTER using html2pdf with PHP but I didn't get it. I tried to define width and height instead of A4 but it didn't work. Any solution, please?

$html2pdf = new Html2Pdf('P', array($width_in_mm,$height_in_mm), 'fr', 'true', 'UTF-8', [0, 10, 0, 5]);

Solution

  • I have just found the answer. You need to use 'USLETTER' instead of 'A4'.