This article will explain, how to create a pdf file using mpdf from html / php.
Install php if you are working on local ubuntu machine, on shared hosting mostly php will have been installed.
Below command will install php5 on ubuntu 14.04,
sudo apt-get install php5
If you are using ubuntu 16.04, it comes with php7, which we can install using below steps,
sudo apt-get install libapache2-mod-php
sudo apt-get install php-mbstring
Download mpdf code from website,
git clone https://github.com/lynxbee/mpdf.git
Here, we will try to create a sample example in localhost, so we will need to move this code to localhost,
$ vim mpdfexample.php
$mpdf = new mPDF();
Now, open this php file at localhost in browser as,