HTML or PHP?
Most of the functions of mPDF can be achieved two ways: using PHP commands, or using custom HTML tags. Use whichever suits your purpose better, and you can always combine a mxture of the two.
If you are new to mPDF, I would recommend using HTML/CSS for everything - you can test most things out in a browser this way as you are writing it.
If you want to hide mPDF custom tags from a browser, enclose any mPDF code within:
mPDF will strip away the $<!–mpdf tag and any following spaces, and the $mpdf–> tag and any preceeding spaces, and process all enclosed code e.g.