I finally sorted this out for Centos 5.5 (and probably others in the 5.x line). To get rid of the following error when generating PDF reports:

cannot find font '' ... at
/usr/lib/perl5/site_perl/5.8.8/PDF/API2/Resource/CIDFont/TrueType/FontFile.pm
line 424.
  1. yum install dejavu-lgc-fonts
  2. ln -s /usr/share/fonts/dejavu-lgc /usr/lib/perl5/site_perl/5.8.8/PDF/API2/fonts
  3. Edit Config Settings in Framework -> Core::PDF. Change the following font settings.
    1. PDF::TTFontFile###Proportional = DejaVuLGCSans.ttf
    2. PDF::TTFontFile###ProportionalBold = DejaVuLGCSans-Bold.ttf
    3. PDF::TTFontFile###ProportionalBoldItalic = DejaVuLGCSans-BoldOblique.ttf
    4. PDF::TTFontFile###Monospaced = DejaVuLGCSansMono.ttf

The reason for this change is that the DejaVu fonts have been removed from the v2.019 of the PDF::API2 package. A similar change will probably be necessary for other Linux distros, but the font names may be different.


On 05/05/2011 09:01 AM, James Roman wrote:
I installed the dejavu-lgc-fonts package and created a symbolic link to the directory they are installed in:
ln -s ../../../../../../share/fonts/dejavu-lgc /usr/lib/perl5/site_perl/5.8.8/PDF/API2/fonts

After a restarting the services, I still receive the same error. It looks like an empty font name is being passed to the FontFile.pm module. The specific line (424) reads:

die "cannot find font '$file' ..." unless(-f $file);

I'm not quite sure where the call to FontFile->new() is coming from though. Is there a way to turn on debugging?