How to apply loading style in dompdf

I am using bootstrap grid for display and I want my client to download it in pdf, so I am using dompdf for this, but dompdf cannot apply bootstrap style. I can't go back and turn my loading grid into basic html tables and use another plugin to convert to pdf. I found them difficult and time consuming (especially when installing composer and then updating I'm a newbie) is there a way out so I can easily apply bootstrap style to my pdf

   $pr_dt=$_POST['hid'];//div elements which i want ot convert them to pdf and also contain bootstap lib link
   $dompdf =  new DOMPDF();


or at least there is some online converter for boot grid to html tables


source to share

2 answers

You need to make sure dompdf can find your CSS files. You can do this with set_base_path

, for example:



You also need to specify the CSS file, for example:

    <link type="text/css" href="style.css" rel="stylesheet" />




'in response now I am getting Can't find font class fontmetrics_cls.php on line 346'

This happens when you need to add Dompdf to your application configuration to enable modules. In zf2 its application.config.php under modules section Hope this helps when I find hours looking for this without any documentation.



All Articles