HTML to PDF Convert html to pdf

If already have HTML (invoice html or any other html code) and want to convert it to PDF. You can directly convert HTML to PDF by passing the html. Please note that HTML must be in a standard format supported by mpdf. You can check mpdf website to know the details about HTML data.

  
                            $xinvoice = new Xinvoice();
                            $html ="
Company Contact Country
Alfreds Futterkiste Maria Anders Germany
Centro comercial Moctezuma Francisco Chang Mexico
Ernst Handel Roland Mendel Austria
Island Trading Helen Bennett UK
Laughing Bacchus Winecellars Yoshi Tannamuri Canada
Magazzini Alimentari Riuniti Giovanni Rovelli Italy
"; //convert html to pdf echo $xinvoice->htmlToPDF($html);