PDF::Builder::Lite(3pm) | User Contributed Perl Documentation | PDF::Builder::Lite(3pm) |
PDF::Builder::Lite - Lightweight PDF creation methods
$pdf = PDF::Builder::Lite->new(); $pdf->page(595,842); $img = $pdf->image('some.jpg'); $font = $pdf->corefont('Times-Roman'); $font = $pdf->ttfont('TimesNewRoman.ttf');
If $file is just a hyphen '-', the stringified copy is returned, otherwise the file is saved, and $self is returned (for chaining calls).
Examples:
$font = $pdf->corefont('Times-Roman'); $font = $pdf->corefont('Times-Bold'); $font = $pdf->corefont('Helvetica'); $font = $pdf->corefont('ZapfDingbats');
Examples:
$font = $pdf->ttfont('TimesNewRoman.ttf'); $font = $pdf->ttfont('/fonts/Univers-Bold.ttf'); $font = $pdf->ttfont('../Democratica-SmallCaps.ttf');
Examples:
$font = $pdf->psfont('TimesRoman.pfa', -afmfile => 'TimesRoman.afm', -encode => 'latin1'); $font = $pdf->psfont('/fonts/Univers.pfb', -pfmfile => '/fonts/Univers.pfm', -encode => 'latin2');
Examples:
$egs = $pdf->create_egs();
Defined color-names are:
aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkgrey, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightgrey, lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen
or the rgb-hex-notation:
#rgb, #rrggbb, #rrrgggbbb and #rrrrggggbbbb
or the cmyk-hex-notation:
%cmyk, %ccmmyykk, %cccmmmyyykkk and %ccccmmmmyyyykkkk
or the hsl-hex-notation:
&hsl, &hhssll, &hhhssslll and &hhhhssssllll
or the hsv-hex-notation:
!hsv, !hhssvv, !hhhsssvvv and !hhhhssssvvvv
Example:
$pdf->transform( -translate => [$x,$y], -rotate => $rot, -scale => [$sx,$sy], -skew => [$sa,$sb], )
Per default this has a 72dpi resolution, so if you want an image to have a 150 or 300dpi resolution, you should specify a scale of 72/150 (or 72/300) or adjust width/height accordingly.
Go into text mode, set the font to the object and size, go to the location, set any rotation, set justification, and write the array of text. Justification is 0 for left, 1 for center, and 2 for right.
Alfred Reibenschuh
2021-03-28 | perl v5.32.1 |