DOMPDF 0.5.1 - Fonts not working on live Server

822 views
Skip to first unread message

tomak

unread,
Aug 3, 2011, 8:26:20 AM8/3/11
to dompdf
I've got DOMPDF 0.5.1 running in a Drupal implementation on my
localhost (xampp, windows 7) which generates my Pdf's just fine.
But when i commit this to the live server things go wrong. I get the
error: "The font "Futura" contains a bad /BBox"
And all text is displayed as dots.

Any idea what might be going on?

BrianS

unread,
Aug 3, 2011, 2:24:53 PM8/3/11
to dom...@googlegroups.com
Have you loaded the font locally, then committed the whole code tree to your server? How are you loading the font? In 0.5.1 load_font.php saves absolute paths to dompdf_font_family_cache, which probably won't match up between your dev box and your server. As a result DOMPDF may not be embedding the font correctly (we can look at your PDF structure if you post it online).

tomak

unread,
Aug 4, 2011, 3:22:17 AM8/4/11
to dompdf
Hi Brian, i've commited the whole code tree to the server. Not using
absolute paths in the dompdf_font_family_cache file.
I've tried using version 0.6.0 beta 2 and generate the font files
using the web-based font prep tool (http://eclecticgeek.com/dompdf/
load_font.php) but i still get the exact same error.
If i switch to one of the fonts that come with the installation, i
don't get the error.
I've also tried generating a different font than Futura and this also
results in the bbox error when opening the pdf.
So it seems like any font i add tot he cache won't work. But i'm
baffled why this would work on my dev box.

thanks

Fabien Ménager

unread,
Aug 4, 2011, 3:59:28 AM8/4/11
to dom...@googlegroups.com
Hello, does the web server have write access in the font directory ? 
In dompdf 0.6 there is a page named Setup/Config in the www directory, it will tell you what's wrong.

tomak

unread,
Aug 4, 2011, 4:45:22 AM8/4/11
to dompdf
hi fabien, thanks for pointing me out to this page. The setup page
only showed "Path to the ttf2afm executable" was incorrect, i've
changed this to '/var/www/html/sites/all/modules/dompdf/dompdf/lib/
ttf2ufm/bin/ttf2ufm.exe' but this doesn't fix the font problem.

btw, the font family cache entry for the font looks like this:
'futura' =>
array (
'normal' => DOMPDF_FONT_DIR . 'Futura-light',
'bold' => DOMPDF_FONT_DIR . 'Futura-medium',
'italic' => DOMPDF_FONT_DIR . 'Futura-light-cond',
'bold_italic' => DOMPDF_FONT_DIR . 'Futura-medium-cond',
),

There are .TTF/ufm/afm files for all fonts present. The only
difference i see with the default fonts is that there's no .afm.php
files.

Thanks for your time and help

Fabien Ménager

unread,
Aug 4, 2011, 6:49:15 AM8/4/11
to dom...@googlegroups.com
That's weird, could you attach your .ufm and .ufm.php files ? Did you activate Unicode in the config ?

BrianS

unread,
Aug 4, 2011, 11:44:53 AM8/4/11
to dom...@googlegroups.com
And also the PDF produced? This is one instance where looking at the PDF may help determine what's going on.
Reply all
Reply to author
Forward
0 new messages