1

Hello All -

I tried to add a custom font in my PDF. I created TCPDF compatible files add place all files in my fonts folder under TCPDF. My location for TCPDF is as below.

html2pdf/_tcpdf_5.0.002/fonts/myfontname.php
html2pdf/_tcpdf_5.0.002/fonts/myfontname.z
html2pdf/_tcpdf_5.0.002/fonts/myfontname.ctg.z

Below is my code where I add that font in PDF and use it in CSS with the name 'bauhaus93'.

include_once("html2pdf/html2pdf.class.php");
$html2pdf = new HTML2PDF('P', 'A4', 'en', true, 'UTF-8', array(0,0,0,0));
$html2pdf->addFont('bauhaus93', '', '/html2pdf/_tcpdf_5.0.002/fonts/bauhaus93.php');
$html = $this->_getParam("postData");
$html2pdf->writeHTML($html, isset($_GET['vuehtml']));
$html2pdf->Output('./files/sample2.pdf','F');

When I try to create the PDF I got the below error message.

TCPDF ERROR: Could not include font definition file: 'bauhaus93'

Please let me know what I am doing wrong. Thanks in advance for any help.

Regards,
Sohail