1PDF::API2::Lite(3) User Contributed Perl Documentation PDF::API2::Lite(3)
2
3
4
6 PDF::API2::Lite - (do not use)
7
9 $pdf = PDF::API2::Lite->new;
10 $pdf->page(595,842);
11 $img = $pdf->image('some.jpg');
12 $font = $pdf->corefont('Times-Roman');
13 $font = $pdf->ttfont('TimesNewRoman.ttf');
14
16 This class is unmaintained (since 2007) and should not be used in new
17 code. It combines many of the methods from PDF::API2 and
18 PDF::API2::Content into a single class but isn't otherwise any easier
19 to use.
20
21 There have been many improvements and clarifications made to the rest
22 of the distribution that aren't reflected here, so the term "Lite" no
23 longer applies. It remains solely for compatibility with existing
24 legacy code.
25
27 $pdf = PDF::API2::Lite->new
28 $pdf->page
29 $pdf->page $width,$height
30 $pdf->page $llx, $lly, $urx, $ury
31 Opens a new page.
32
33 $pdf->mediabox $w, $h
34 $pdf->mediabox $llx, $lly, $urx, $ury
35 Sets the global mediabox.
36
37 $pdf->saveas $file
38 Saves the document (may not be modified later) and deallocates the
39 pdf-structures.
40
41 $font = $pdf->corefont $fontname
42 Returns a new or existing adobe core font object.
43
44 Examples:
45
46 $font = $pdf->corefont('Times-Roman');
47 $font = $pdf->corefont('Times-Bold');
48 $font = $pdf->corefont('Helvetica');
49 $font = $pdf->corefont('ZapfDingbats');
50
51 $font = $pdf->ttfont $ttfile
52 Returns a new or existing truetype font object.
53
54 Examples:
55
56 $font = $pdf->ttfont('TimesNewRoman.ttf');
57 $font = $pdf->ttfont('/fonts/Univers-Bold.ttf');
58 $font = $pdf->ttfont('../Democratica-SmallCaps.ttf');
59
60 $font = $pdf->psfont($ps_file, [%options])
61 Returns a new type1 font object.
62
63 Examples:
64
65 $font = $pdf->psfont('TimesRoman.pfa', -afmfile => 'TimesRoman.afm', -encode => 'latin1');
66 $font = $pdf->psfont('/fonts/Univers.pfb', -pfmfile => '/fonts/Univers.pfm', -encode => 'latin2');
67
68 $egs = $pdf->create_egs
69 Returns a new extended-graphics-state object.
70
71 Examples:
72
73 $egs = $pdf->create_egs;
74
75 $img = $pdf->image_jpeg $file
76 Returns a new jpeg-image object.
77
78 $img = $pdf->image_png $file
79 Returns a new png-image object.
80
81 $img = $pdf->image_tiff $file
82 Returns a new tiff-image object.
83
84 $img = $pdf->image_pnm $file
85 Returns a new pnm-image object.
86
87 $pdf->savestate
88 Saves the state of the page.
89
90 $pdf->restorestate
91 Restores the state of the page.
92
93 $pdf->egstate $egs
94 Sets extended-graphics-state.
95
96 $pdf->fillcolor $color
97 Sets fillcolor.
98
99 $pdf->strokecolor $color
100 Sets strokecolor.
101
102 Defined color-names are:
103
104 aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond,
105 blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue,
106 cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkgrey,
107 darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon,
108 darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet,
109 deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen,
110 fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew,
111 hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon,
112 lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightgrey,
113 lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey,
114 lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine,
115 mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen,
116 mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite,
117 navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen,
118 paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple,
119 red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna,
120 silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal,
121 thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen
122
123 or the rgb-hex-notation:
124
125 #rgb, #rrggbb, #rrrgggbbb and #rrrrggggbbbb
126
127 or the cmyk-hex-notation:
128
129 %cmyk, %ccmmyykk, %cccmmmyyykkk and %ccccmmmmyyyykkkk
130
131 or the hsl-hex-notation:
132
133 &hsl, &hhssll, &hhhssslll and &hhhhssssllll
134
135 and additionally the hsv-hex-notation:
136
137 !hsv, !hhssvv, !hhhsssvvv and !hhhhssssvvvv
138
139 $pdf->linedash @dash
140 Sets linedash.
141
142 $pdf->linewidth $width
143 Sets linewidth.
144
145 $pdf->transform %opts
146 Sets transformations (eg. translate, rotate, scale, skew) in pdf-
147 canonical order.
148
149 Example:
150
151 $pdf->transform(
152 -translate => [$x,$y],
153 -rotate => $rot,
154 -scale => [$sx,$sy],
155 -skew => [$sa,$sb],
156 )
157
158 $pdf->move $x, $y
159 $pdf->line $x, $y
160 $pdf->curve $x1, $y1, $x2, $y2, $x3, $y3
161 $pdf->arc $x, $y, $a, $b, $alfa, $beta, $move
162 $pdf->ellipse $x, $y, $a, $b
163 $pdf->circle $x, $y, $r
164 $pdf->rect $x,$y, $w,$h
165 $pdf->rectxy $x1,$y1, $x2,$y2
166 $pdf->poly $x1,$y1, ..., $xn,$yn
167 $pdf->close
168 $pdf->stroke
169 $pdf->fill
170 $pdf->fillstroke
171 $pdf->image $imgobj, $x,$y, $w,$h
172 $pdf->image $imgobj, $x,$y, $scale
173 $pdf->image $imgobj, $x,$y
174 Please Note: The width/height or scale given is in user-space
175 coordinates which is subject to transformations which may have been
176 specified beforehand.
177
178 Per default this has a 72dpi resolution, so if you want an image to
179 have a 150 or 300dpi resolution, you should specify a scale of
180 72/150 (or 72/300) or adjust width/height accordingly.
181
182 $pdf->textstart
183 $pdf->textfont $fontobj,$size
184 $txt->textleading $leading
185 $pdf->text $string
186 Applies the given text.
187
188 $pdf->nl
189 $pdf->textend
190 $pdf->print $font, $size, $x, $y, $rot, $just, $text
191 Convenience wrapper for shortening the textstart..textend sequence.
192
193
194
195perl v5.34.0 2022-01-21 PDF::API2::Lite(3)