как добавить файл css в mpdf

Я пытаюсь преобразовать html в pdf, используя mpdf. Проблема в том, что я не могу применить CSS в файл pdf.

Вот мой код php:

<?php $html = $divPrint; $mpdf=new mPDF(); $stylesheet = file_get_contents('pdf.css'); $mpdf->WriteHTML($stylesheet,1); $mpdf->WriteHTML($html,2); $mpdf->Output(); exit; ?> 

То, что он делает, – это взять html через ajax на моей странице php. Но вывод, который он дает, не приходит с css, который я написал для него.

Пожалуйста, скажите мне, что делать сейчас?

  <?php $html = $divPrint; include('mpdf.php'); // including mpdf.php $mpdf=new mPDF(); $stylesheet = file_get_contents('pdf.css'); // external css $mpdf->WriteHTML($stylesheet,1); $mpdf->WriteHTML($html,2); $mpdf->Output(); exit; ?> в  <?php $html = $divPrint; include('mpdf.php'); // including mpdf.php $mpdf=new mPDF(); $stylesheet = file_get_contents('pdf.css'); // external css $mpdf->WriteHTML($stylesheet,1); $mpdf->WriteHTML($html,2); $mpdf->Output(); exit; ?> 

1-й присвойте свой html в $html затем включите файл mpdf.php .