Subject: | bug in PDF-API2-Lite |
Date: | Wed, 13 May 2015 13:58:32 -0400 |
To: | "bug-PDF-API2 [...] rt.cpan.org" <bug-PDF-API2 [...] rt.cpan.org> |
From: | Charles Stuart Lemmen <CLemmen [...] excelsiorintegrated.com> |
Greetings,
I've discovered a "bug" in the documentation for the PDF::API2::Lite package. Specifically, the documentation for creating a psfont file reference for a PDF file is incorrect. The documentation states that the call should be made this way:
$font = $pdf->psfont('/fonts/Univers.pfb','/fonts/Univers.afm','latin2');
However, this always results in an error being thrown EG:
no proper font-metrics file specified for '/fonts/Univers.pfb'. at C:/Perl64/site/lib/PDF/API2/Resource/Font/Postscript.pm line 27.
The fix is simple, format the call the way the PDF:: API2 documentation says to:
$font = $pdf->psfont('/fonts/Univers.pfb', -afmfile => '/fonts/Univers.afm', -encode => 'latin2');
And the errors disappear and PDF files are created normally. Due I see as the psfont() method is simply a pass-through to the 'api' class instance ref:
return $self->{api}->psfont(@args);
Thanks for writing PDF::API2::Lite.
Distribution name and version: PDF::API2::Lite ver. 2.023
Perl version: This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x64-multi-thread
Operating System vendor and version: Windows 8 ver 6.3 (build 9600)
Stuart Lemmen
IT Development & Support
Excelsior Integrated LLC
413-394-4340
clemmen@excelsiorintegrated.com<mailto:clemmen@excelsiorintegrated.com>
www.excelsiorintegrated.com<http://www.excelsiorintegrated.com>
[cid:image001.png@01D08D84.04F8D440]