I'm trying to use HTML2PDF 4.03 with this code:
<?php
$content = "..."; # my HTML code
require_once(dirname(__FILE__).'/html2pdf_v4.03/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','en', true, 'utf-8', array(15,20,15,20) );
# here I'm trying to add my arial.ttf
$html2pdf->pdf->AddTTFFont('arial.ttf');
$html2pdf->WriteHTML($content);
$html2pdf->Output('exemple.pdf');
?>
Now the program die with this:
PHP Fatal error: Call to undefined method HTML2PDF_myPdf::AddTTFFont()
How can I add TTF font to my PDF file?
$html2pdf->setDefaultFont("francoisone");
. But when I try this:$html2pdf->setDefaultFont('OpenSans'); $html2pdf->addFont('francoisone', '', 'francoisone');
, I can't usefont-family: francoisone;
in my css. Is there something wrong with my setup? – Brat