PDF Page Size not working in V7.12.2

Did a fresh install of v7.12.2 and PDF Templates ā€˜Page Size’ has no effect.
Pages always come out A4.
Letter (should be 8.5"x11") comes out A4 (8.27"x11.69").
Same for ā€˜legal’.
Worked fine in V7.11.22

Probably related to this

the PDF engine had to be changed for licensing reasons…

One solution:
In studio/dropdown editor/pdf_page_size_dom delete ā€˜Letter’ and replace with ā€˜LETTER’ (item name).

To fix the ’Page Size’ issue in the SuiteCRM 7.12.2 Version, you need to make changes in the Default file which is responsible for the PDF Generation. Currently ā€˜Page Size’ is not passed as a Capital Letter that’s the reason for no effect while exporting the PDF.

You need to pass the ā€˜Page Size’ value in strtoupper.

Modify the Code in below file,

/modules/AOS_PDF_Templates/generatePdf.php (Approx. Line number 147)