I am making a custom deign application for the web at Viva Concepts. I have everything working great on this now, but the custom fonts. Specifically, there are 4 signature fonts that the person can pick from (Google Fonts: Stalemate, Mr De Haviland, Mrs Saint Delafield and Herr Con Muellerhoff).
I have tried this with html2pdf, which uses TCPDF as it's backend and I get a "TCPDF ERROR: Could not include font definition file: 'stalemate'" (see the post on stack overflow). When I set this font as default, it works fine, but all the text is now Stalemate instead of just one sentence. This is a differnt PDF library, so then I moved over to DOMPDF, which I already use throughout the site.
I made a sample html page that has the html code I want to make into a pdf and then have a separate page that runs the pdf converter code. Here is the link to those pages:
When I use DOMPDF the font 'stalemate' does not show up. It does not seem to error out and produces a PDF, but it makes the text invisible. I can copy the text from the pdf that is made and paste it into a text document, so the text is there, just not showing up.
In making the fonts I have used all 3 ways of making the font files, not of which made a difference. Though with php-font-lib this should handle it automatically now. I can see that the fonts are made and added to the dompdf_font_family_cache file as well, but still no luck.
I have been checking through forums and banging my head to figure this out for weeks now, with no luck.
The following is the php code that I have in the PDF Converter Page:
<?php
require_once 'dompdf/dompdf_config.inc.php';
$url = 'http://mattodesigns.com/PDFs/sample.html';
$source = file_get_contents($url);
$html = str_replace(array("\r", "\n", "\t"), '', $source);
$dompdf = new DOMPDF();
$dompdf->set_paper('viva insert');
$dompdf->load_html($html);
$dompdf->render();
$pdf = $dompdf->output();
$dompdf->stream("first_PDF_file.pdf", array("Attachment" => false));
?>
Really need some help on this to sort it out.