Introduction
Issues
Generic Issues
- Q: How do i do a "hello world" example in ::API ?
-
A: The quick source to this would be:
use Text::PDF::API; $pdf=Text::PDF::API->new; $pdf->newFont('Helvetica'); $pdf->newpage(); $pdf->useFont('Helvetica',20); $pdf->showTextXY(20,750,"Hello PDF World !"); $pdf->endpage(); $pdf->saveas("hello.pdf"); $pdf->end;
The resultant output can be seen here.
Font Issues
- Q: How can i use the truetype-font "xx" with ::API ?
-
A: Simply use newFontTTF instead of newFont
$pdf->newFontTTF('my_xx_ttf,font',$xx_ttf_file); $pdf->useFont('my_xx_ttf,font',20);
- Q: How can i use the postscript-font "yy" with ::API ?
-
A: Substitute newFontPS for newFont
$pdf->newFontPS('my_yyfont',$yy_afm_file,$yy_pfb_file); $pdf->useFont('my_yyfont',20);
- Q: Why do i need these funny "afm" files when using postscript fonts ?
-
A: Adobe Type1 Postscript fonts are usually spread over a bunch of files, all with the following naming format:
(our_fonts_base_name).(extension)
The actual glyphs (characters) of the font reside usually in files with the extension .PFB or .PFA and describe how to draw them in the first place.
The dimensions and relations of the glyphs (width, height, name) reside in a file with the extension .AFM (ie. font-metrics).
There are also files with the extension .PFM which usually come with the windows version of fonts, which contain a limited set of the data found in a AFM file for a specific character-encoding only (usually windows-specific).
Since ::API uses a cross-encoding schema for using and accessing fonts, it cant use PFM files, which are usually unavailable under unix and do not contain enough information of ::API.
See the readme on how to work around this !
Text Issues
- Q: if i use textParagraph or textNewLine, why are the lines printer over each other ?
-
A: Because you didn't set text-leading to something reasonable !
Text-Leading controls the actual distance from one line to the next and its defaults both in the pdf-spec and ::API are 0 (zero).
For a graphical explanation refer to: "5.2.4 Leading" in "PDF Reference second edition" pg. 282
Graphical Issues
Image Issues
Author
Last Words
7 POD Errors
The following errors were encountered while parsing the POD:
- Around line 81:
Unknown directive: =title
- Around line 89:
'=item' outside of any '=over'
- Around line 119:
You forgot a '=back' before '=head3'
- Around line 121:
'=item' outside of any '=over'
- Around line 160:
You forgot a '=back' before '=head3'
- Around line 162:
'=item' outside of any '=over'
- Around line 171:
You forgot a '=back' before '=head3'