I'm working on a project that needs to convert an HTML page to PDF. I am using dompdf library in my project, however, I'm having trouble with embedding custom fonts in the PDF preview. I was expecting pdfdom will automatically embed any attached fonts like it normally work in HTML. Or is there any configuration needed first?
Here's the HTML content
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
<link href='http://fonts.googleapis.com/css?family=Give+You+Glory&v2' rel='stylesheet' type='text/css'>
</head>
<body>
<h2>Give You Glory</h2>
<p style="font-family: 'Give You Glory', sans-serif;">
Grumpy wizards make toxic brew for the evil Queen and Jack
</p>
</body>
</html>
And here's how the library usage:
$dompdf = new Dompdf();
$dompdf->setPaper('A4', 'landscape');
$dompdf->loadHtml($html_content);
$dompdf->render();
$dompdf->stream("testing.pdf", array("Attachment"=>0));