Here is a solution to this problem:
$ html2pdf = new HTML2PDF ('P', array ($ width_in_mm, $ height_in_mm), 'en', true, 'UTF-8', array (0, 0, 0, 0));
Width and height should be in MM. If your used inches convert it to MM.
Formula: $ width_in_mm = $ width_in_inches * 25.4; $ height_in_mm = $ height_in_inches * 25.4;
Do not round it. The exact conversion is used, even if it has a decimal point.
Hope this answer solves your problem.
source share