Using Calibri with DOMpdf
I am using DOMpdf to generate some letters with PHP. My client has requested that I use Calibri as the body font, which I have attempted to convert to a DOMpdf-readable format using this tool: http://eclecticgeek.com/dompdf/load_font.php.
Unfortunately when it comes to generating the file I am getting PHP errors complaining about an undefined index:
Severity: Notice
Message: Undefined index:
Filename: lib/class.pdf.php
Line Number: 3230
I have looked into 开发者_Go百科the error and it seems like it's something to do with the bounding box definition of the file. I'm not sure what's going on here.
I am using the following line in my document:
font-family: calibri, sans-serif;
The key in dompdf_font_family_cache is 'calibri' and refers to files that exist.
Has anyone had any experience at all with the DOMPDF library and the Calibri font? Any help here would be extremely appreciated!
you may have used the EXE parser, you should use the PHP one, which works better. DOMPDF won't need this anymore in the next version, as you'll be able to specify new fonts using the @font-face CSS feature. This is already available in the version from the SVN trunk.
EDIT: It is a problem with the version of DOMPDF you are using (0.5.2). The dompdf_font_family_cache file doesn't have the right format (which has changed a little bit in 0.6 beta). You need to remove the <?php
at the beginning of this file and possibly the ?>
at the end.
精彩评论