Однажды все сработало хорошо. Недавно я обновил MPDF, и кажется, что теперь теги, связанные с WTH Font-Weight: жирные стили больше не работают.
CSS загружается, потому что я могу успешно видеть другие стили от внешних CSS, которые я кодировал, но не могу получить смелый текст. Есть идея? Я загружаю MPDF как всегда: < /p>
protected function save_pdf($translate = false){
$this->mpdf = new \Mpdf\Mpdf();
if($this->disable_ssl_check) $this->mpdf->curlAllowUnsafeSslRequests = true;
$this->mpdf->CSSselectMedia='mpdf';
$this->mpdf->showImageErrors = true;
$ch = curl_init($this->pdf_css_path . '/configurator-pdf.css');
if($this->disable_ssl_check) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$css = curl_exec($ch);
curl_close($ch);
$filename = ($translate) ? $this->pdf_name : $this->pdf_it_name;
$_POST['cid'] = $this->cid;
$_POST['translate'] = ($translate) ? 1 : 0;
$json = json_encode($_POST);
$ch = curl_init($this->pdf_template_url);
if($this->disable_ssl_check) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Content-Length: ' . strlen($json) ]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
$html = curl_exec($ch);
curl_close($ch);
$this->mpdf->WriteHTML($css, 1);
$this->mpdf->WriteHTML($html, 2);
$pdf = $this->pdf_destination_path . DS . $filename;
$this->mpdf->Output($pdf, \Mpdf\Output\Destination::FILE);
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... xt-in-mpdf