line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::Builder::Lite; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
67532
|
use strict; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
56
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
149
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '3.024'; # VERSION |
7
|
|
|
|
|
|
|
our $LAST_UPDATE = '3.024'; # manually update whenever code is changed |
8
|
|
|
|
|
|
|
# NOTE that this sub-package has not been tested and is not well documented! |
9
|
|
|
|
|
|
|
# It is possible that it will be deprecated and removed. |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
0
|
BEGIN { |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
763
|
use PDF::Builder; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
69
|
|
14
|
2
|
|
|
2
|
|
13
|
use PDF::Builder::Util; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
263
|
|
15
|
2
|
|
|
2
|
|
14
|
use PDF::Builder::Basic::PDF::Utils; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
141
|
|
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
12
|
use POSIX qw( ceil floor ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
18
|
2
|
|
|
2
|
|
174
|
use Scalar::Util qw(blessed); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
93
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
13
|
use vars qw( $hasWeakRef ); |
|
2
|
|
|
0
|
|
4
|
|
|
2
|
|
|
|
|
3701
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
PDF::Builder::Lite - Lightweight PDF creation methods |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$pdf = PDF::Builder::Lite->new(); |
31
|
|
|
|
|
|
|
$pdf->page(595,842); |
32
|
|
|
|
|
|
|
$img = $pdf->image('some.jpg'); |
33
|
|
|
|
|
|
|
$font = $pdf->corefont('Times-Roman'); |
34
|
|
|
|
|
|
|
$font = $pdf->ttfont('TimesNewRoman.ttf'); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 DESCRIPTION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This class is unmaintained (since 2007) and should not be used in new code. It |
39
|
|
|
|
|
|
|
combines many of the methods from L and L |
40
|
|
|
|
|
|
|
into a single class but isn't really otherwise any easier to use. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
There have been many improvements and clarifications made to the rest of the |
43
|
|
|
|
|
|
|
distribution that aren't reflected here, so the term "Lite" no longer applies. |
44
|
|
|
|
|
|
|
It remains solely for compatibility with existing legacy code. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 METHODS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=over |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item $pdf = PDF::Builder::Lite->new(%opts) |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item $pdf = PDF::Builder::Lite->new() |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub new { |
57
|
3
|
|
|
3
|
1
|
2472
|
my ($class, %opts) = @_; |
58
|
|
|
|
|
|
|
|
59
|
3
|
|
|
|
|
9
|
my $self = {}; |
60
|
3
|
|
|
|
|
10
|
bless($self, $class); |
61
|
3
|
|
|
|
|
28
|
$self->{'api'} = PDF::Builder->new(%opts); |
62
|
|
|
|
|
|
|
|
63
|
3
|
|
|
|
|
768
|
return $self; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item $pdf->page() |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item $pdf->page($width,$height) |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item $pdf->page($llx,$lly, $urx,$ury) |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Opens a new page. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub page { |
77
|
1
|
|
|
1
|
1
|
1268
|
my $self = shift(); |
78
|
1
|
|
|
|
|
9
|
$self->{'page'} = $self->{'api'}->page(); |
79
|
1
|
50
|
|
|
|
5
|
$self->{'page'}->mediabox(@_) if $_[0]; |
80
|
1
|
|
|
|
|
7
|
$self->{'gfx'} = $self->{'page'}->gfx(); |
81
|
|
|
|
|
|
|
# $self->{'gfx'}->compressFlate(); |
82
|
1
|
|
|
|
|
8
|
return $self; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item $pdf->mediabox($w,$h) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item $pdf->mediabox($llx,$lly, $urx,$ury) |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Sets the global mediabox. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub mediabox { |
94
|
1
|
|
|
1
|
1
|
4
|
my ($self, $x1,$y1, $x2,$y2) = @_; |
95
|
1
|
50
|
|
|
|
5
|
if (defined $x2) { |
96
|
0
|
|
|
|
|
0
|
$self->{'api'}->mediabox($x1,$y1, $x2,$y2); |
97
|
|
|
|
|
|
|
} else { |
98
|
1
|
|
|
|
|
7
|
$self->{'api'}->mediabox($x1,$y1); |
99
|
|
|
|
|
|
|
} |
100
|
1
|
|
|
|
|
4
|
return $self; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item $pdf->saveas($file) |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Saves the document (may B be modified later) and |
106
|
|
|
|
|
|
|
deallocates the PDF structures. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
If C<$file> is just a hyphen '-', the stringified copy is returned, otherwise |
109
|
|
|
|
|
|
|
the file is saved, and C<$self> is returned (for chaining calls). |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub saveas { |
114
|
1
|
|
|
1
|
1
|
3
|
my ($self, $file) = @_; |
115
|
|
|
|
|
|
|
|
116
|
1
|
50
|
|
|
|
6
|
if ($file eq '-') { |
117
|
1
|
|
|
|
|
7
|
return $self->{'api'}->to_string(); |
118
|
|
|
|
|
|
|
} else { |
119
|
0
|
|
|
|
|
0
|
$self->{'api'}->saveas($file); |
120
|
0
|
|
|
|
|
0
|
return $self; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
# is the following code ever reached? - Phil |
123
|
|
|
|
|
|
|
#$self->{'api'}->end(); |
124
|
0
|
|
|
|
|
0
|
foreach my $k (keys %{$self}) { |
|
0
|
|
|
|
|
0
|
|
125
|
0
|
0
|
0
|
|
|
0
|
if (blessed($k) and $k->can('release')) { |
|
|
0
|
0
|
|
|
|
|
126
|
0
|
|
|
|
|
0
|
$k->release(1); |
127
|
|
|
|
|
|
|
} elsif (blessed($k) and $k->can('end')) { |
128
|
0
|
|
|
|
|
0
|
$k->end(); |
129
|
|
|
|
|
|
|
} |
130
|
0
|
|
|
|
|
0
|
$self->{$k} = undef; |
131
|
0
|
|
|
|
|
0
|
delete($self->{$k}); |
132
|
|
|
|
|
|
|
} |
133
|
0
|
|
|
|
|
0
|
return; |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=item $font = $pdf->corefont($fontname) |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Returns a new or existing Adobe core font object. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
B |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
$font = $pdf->corefont('Times-Roman'); |
144
|
|
|
|
|
|
|
$font = $pdf->corefont('Times-Bold'); |
145
|
|
|
|
|
|
|
$font = $pdf->corefont('Helvetica'); |
146
|
|
|
|
|
|
|
$font = $pdf->corefont('ZapfDingbats'); |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub corefont { |
151
|
4
|
|
|
4
|
1
|
2147
|
my ($self, $name, @opts) = @_; |
152
|
|
|
|
|
|
|
|
153
|
4
|
|
|
|
|
20
|
my $obj = $self->{'api'}->corefont($name, @opts); |
154
|
4
|
|
|
|
|
15
|
return $obj; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item $font = $pdf->ttfont($ttfile) |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Returns a new or existing TrueType font object. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
B |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
$font = $pdf->ttfont('TimesNewRoman.ttf'); |
164
|
|
|
|
|
|
|
$font = $pdf->ttfont('/fonts/Univers-Bold.ttf'); |
165
|
|
|
|
|
|
|
$font = $pdf->ttfont('../Democratica-SmallCaps.ttf'); |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=cut |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub ttfont { |
170
|
0
|
|
|
0
|
1
|
0
|
my ($self, $file, @opts) = @_; |
171
|
|
|
|
|
|
|
|
172
|
0
|
|
|
|
|
0
|
return $self->{'api'}->ttfont($file, @opts); |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item $font = $pdf->psfont($ps_file, %options) |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=item $font = $pdf->psfont($ps_file) |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Returns a new Type1 (PS) font object. |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
B |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
$font = $pdf->psfont('TimesRoman.pfa', 'afmfile' => 'TimesRoman.afm', 'encode' => 'latin1'); |
184
|
|
|
|
|
|
|
$font = $pdf->psfont('/fonts/Univers.pfb', 'pfmfile' => '/fonts/Univers.pfm', 'encode' => 'latin2'); |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=cut |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
sub psfont { |
189
|
0
|
|
|
0
|
1
|
0
|
my ($self, @args) = @_; |
190
|
|
|
|
|
|
|
|
191
|
0
|
|
|
|
|
0
|
return $self->{'api'}->psfont(@args); |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
#=item @color = $pdf->color($colornumber [, $lightdark ]) |
195
|
|
|
|
|
|
|
# |
196
|
|
|
|
|
|
|
#=item @color = $pdf->color($basecolor [, $lightdark ]) |
197
|
|
|
|
|
|
|
# |
198
|
|
|
|
|
|
|
#Returns a color. |
199
|
|
|
|
|
|
|
# |
200
|
|
|
|
|
|
|
#B |
201
|
|
|
|
|
|
|
# |
202
|
|
|
|
|
|
|
# @color = $pdf->color(0); # 50% grey |
203
|
|
|
|
|
|
|
# @color = $pdf->color(0,+4); # 10% grey |
204
|
|
|
|
|
|
|
# @color = $pdf->color(0,-3); # 80% grey |
205
|
|
|
|
|
|
|
# @color = $pdf->color('yellow'); # yellow, fully saturated |
206
|
|
|
|
|
|
|
# @color = $pdf->color('red',+1); # red, +10% white |
207
|
|
|
|
|
|
|
# @color = $pdf->color('green',-2); # green, +20% black |
208
|
|
|
|
|
|
|
# |
209
|
|
|
|
|
|
|
#=cut |
210
|
|
|
|
|
|
|
# |
211
|
|
|
|
|
|
|
#sub color { |
212
|
|
|
|
|
|
|
# my $self = shift(); |
213
|
|
|
|
|
|
|
# |
214
|
|
|
|
|
|
|
# return $self->{'api'}->businesscolor(@_); |
215
|
|
|
|
|
|
|
#} |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=item $egs = $pdf->create_egs() |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
Returns a new extended-graphics-state object. |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
B |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
$egs = $pdf->create_egs(); |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=cut |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
sub create_egs { |
228
|
1
|
|
|
1
|
1
|
9
|
my ($self) = @_; |
229
|
|
|
|
|
|
|
|
230
|
1
|
|
|
|
|
8
|
return $self->{'api'}->egstate(); |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=item $img = $pdf->image_jpeg($file) |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
Returns a new JPEG image object. |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=cut |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
sub image_jpeg { |
240
|
0
|
|
|
0
|
1
|
|
my ($self, $file) = @_; |
241
|
|
|
|
|
|
|
|
242
|
0
|
|
|
|
|
|
return $self->{'api'}->image_jpeg($file); |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
=item $img = $pdf->image_png($file) |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
Returns a new PNG image object. |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=cut |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
sub image_png { |
252
|
0
|
|
|
0
|
1
|
|
my ($self, $file) = @_; |
253
|
|
|
|
|
|
|
|
254
|
0
|
|
|
|
|
|
return $self->{'api'}->image_png($file); |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=item $img = $pdf->image_tiff($file, %opts) |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=item $img = $pdf->image_tiff($file) |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
Returns a new TIFF image object. |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=cut |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
sub image_tiff { |
266
|
0
|
|
|
0
|
1
|
|
my ($self, $file, @opts) = @_; |
267
|
|
|
|
|
|
|
|
268
|
0
|
|
|
|
|
|
return $self->{'api'}->image_tiff($file, @opts); |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=item $img = $pdf->image_pnm($file) |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
Returns a new PNM image object. |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=cut |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
sub image_pnm { |
278
|
0
|
|
|
0
|
1
|
|
my ($self, $file) = @_; |
279
|
|
|
|
|
|
|
|
280
|
0
|
|
|
|
|
|
return $self->{'api'}->image_pnm($file); |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=item $pdf->savestate() |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
Saves the state of the page. |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=cut |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
sub savestate { |
290
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
291
|
|
|
|
|
|
|
|
292
|
0
|
|
|
|
|
|
return $self->{'gfx'}->save(); |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
=item $pdf->restorestate() |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
Restores the state of the page. |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
=cut |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
sub restorestate { |
302
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
303
|
|
|
|
|
|
|
|
304
|
0
|
|
|
|
|
|
return $self->{'gfx'}->restore(); |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=item $pdf->egstate($egs) |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
Sets extended-graphics state. |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=cut |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
sub egstate { |
314
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
315
|
|
|
|
|
|
|
|
316
|
0
|
|
|
|
|
|
$self->{'gfx'}->egstate(@_); |
317
|
0
|
|
|
|
|
|
return $self; |
318
|
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=item $pdf->fillcolor($color) |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
Sets the fill color. See C for color names and specifications. |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
=cut |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
sub fillcolor { |
327
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
328
|
|
|
|
|
|
|
|
329
|
0
|
|
|
|
|
|
$self->{'gfx'}->fillcolor(@_); |
330
|
0
|
|
|
|
|
|
return $self; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
=item $pdf->strokecolor($color) |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
Sets the stroke color. |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
B |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, black, blanchedalmond, |
340
|
|
|
|
|
|
|
blue, blueviolet, brown, burlywood, cadetblue, chartreuse, chocolate, coral, cornflowerblue, |
341
|
|
|
|
|
|
|
cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, darkgrey, |
342
|
|
|
|
|
|
|
darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, darksalmon, |
343
|
|
|
|
|
|
|
darkseagreen, darkslateblue, darkslategray, darkslategrey, darkturquoise, darkviolet, |
344
|
|
|
|
|
|
|
deeppink, deepskyblue, dimgray, dimgrey, dodgerblue, firebrick, floralwhite, forestgreen, |
345
|
|
|
|
|
|
|
fuchsia, gainsboro, ghostwhite, gold, goldenrod, gray, grey, green, greenyellow, honeydew, |
346
|
|
|
|
|
|
|
hotpink, indianred, indigo, ivory, khaki, lavender, lavenderblush, lawngreen, lemonchiffon, |
347
|
|
|
|
|
|
|
lightblue, lightcoral, lightcyan, lightgoldenrodyellow, lightgray, lightgreen, lightgrey, |
348
|
|
|
|
|
|
|
lightpink, lightsalmon, lightseagreen, lightskyblue, lightslategray, lightslategrey, |
349
|
|
|
|
|
|
|
lightsteelblue, lightyellow, lime, limegreen, linen, magenta, maroon, mediumaquamarine, |
350
|
|
|
|
|
|
|
mediumblue, mediumorchid, mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen, |
351
|
|
|
|
|
|
|
mediumturquoise, mediumvioletred, midnightblue, mintcream, mistyrose, moccasin, navajowhite, |
352
|
|
|
|
|
|
|
navy, oldlace, olive, olivedrab, orange, orangered, orchid, palegoldenrod, palegreen, |
353
|
|
|
|
|
|
|
paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink, plum, powderblue, purple, |
354
|
|
|
|
|
|
|
red, rosybrown, royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell, sienna, |
355
|
|
|
|
|
|
|
silver, skyblue, slateblue, slategray, slategrey, snow, springgreen, steelblue, tan, teal, |
356
|
|
|
|
|
|
|
thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, yellowgreen |
357
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
or the rgb-hex-notation: |
359
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
#rgb, #rrggbb, #rrrgggbbb and #rrrrggggbbbb |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
or the cmyk-hex-notation: |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
%cmyk, %ccmmyykk, %cccmmmyyykkk and %ccccmmmmyyyykkkk |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
or the hsl-hex-notation: |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
&hsl, &hhssll, &hhhssslll and &hhhhssssllll |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
or the hsv-hex-notation: |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
!hsv, !hhssvv, !hhhsssvvv and !hhhhssssvvvv |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=cut |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub strokecolor { |
377
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
378
|
|
|
|
|
|
|
|
379
|
0
|
|
|
|
|
|
$self->{'gfx'}->strokecolor(@_); |
380
|
0
|
|
|
|
|
|
return $self; |
381
|
|
|
|
|
|
|
} |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=item $pdf->linedash(@dash) |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
Sets the line dash pattern. |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=cut |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
sub linedash { |
390
|
0
|
|
|
0
|
1
|
|
my ($self, @a) = @_; |
391
|
0
|
|
|
|
|
|
$self->{'gfx'}->linedash(@a); |
392
|
0
|
|
|
|
|
|
return $self; |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=item $pdf->linewidth($width) |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
Sets the line width. |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=cut |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
sub linewidth { |
402
|
0
|
|
|
0
|
1
|
|
my ($self, $linewidth) = @_; |
403
|
|
|
|
|
|
|
|
404
|
0
|
|
|
|
|
|
$self->{'gfx'}->linewidth($linewidth); |
405
|
0
|
|
|
|
|
|
return $self; |
406
|
|
|
|
|
|
|
} |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=item $pdf->transform(%opts) |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
Sets transformations (i.e., translate, rotate, scale, skew) in PDF-canonical order. |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
B |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
$pdf->transform( |
415
|
|
|
|
|
|
|
'translate' => [$x,$y], |
416
|
|
|
|
|
|
|
'rotate' => $rot, |
417
|
|
|
|
|
|
|
'scale' => [$sx,$sy], |
418
|
|
|
|
|
|
|
'skew' => [$sa,$sb], |
419
|
|
|
|
|
|
|
) |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=cut |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
sub transform { |
424
|
0
|
|
|
0
|
1
|
|
my ($self, %opt) = @_; |
425
|
|
|
|
|
|
|
|
426
|
0
|
|
|
|
|
|
$self->{'gfx'}->transform(%opt); |
427
|
0
|
|
|
|
|
|
return $self; |
428
|
|
|
|
|
|
|
} |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
=item $pdf->move($x,$y) |
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
Move to a new drawing location at C[$x,$y]. |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
=cut |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
sub move { # x,y ... |
437
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
438
|
|
|
|
|
|
|
|
439
|
0
|
|
|
|
|
|
$self->{'gfx'}->move(@_); |
440
|
0
|
|
|
|
|
|
return $self; |
441
|
|
|
|
|
|
|
} |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
=item $pdf->line($x,$y) |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
Draw a line to C[$x,$y]. |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
=cut |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
sub line { # x,y ... |
450
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
451
|
|
|
|
|
|
|
|
452
|
0
|
|
|
|
|
|
$self->{'gfx'}->line(@_); |
453
|
0
|
|
|
|
|
|
return $self; |
454
|
|
|
|
|
|
|
} |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=item $pdf->curve($x1,$y1, $x2,$y2, $x3,$y3) |
457
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
Draw a Bezier curve with three control points. |
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
=cut |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
sub curve { # x1,y1,x2,y2,x3,y3 ... |
463
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
464
|
0
|
|
|
|
|
|
$self->{'gfx'}->curve(@_); |
465
|
0
|
|
|
|
|
|
return $self; |
466
|
|
|
|
|
|
|
} |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
=item $pdf->arc($xc,$yc, $rx,$ry, $alpha,$beta, $move, $dir) |
469
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
=item $pdf->arc($xc,$yc, $rx,$ry, $alpha,$beta, $move) |
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
Draw an arc centered at C[$xc,$yc], with x radius C[$rx] and y radius C[$ry], |
473
|
|
|
|
|
|
|
from C[$alpha] degrees to C[$beta] degrees. If C[$move] is I, do B |
474
|
|
|
|
|
|
|
draw a line to the start of the arc. C[$dir] defaults to 0 for counter-clockwise |
475
|
|
|
|
|
|
|
sweep, and may be set to 1 for a clockwise sweep. |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
=cut |
478
|
|
|
|
|
|
|
|
479
|
|
|
|
|
|
|
sub arc { # xc,yc, rx,ry, alpha,beta ,move [,dir] |
480
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
481
|
|
|
|
|
|
|
|
482
|
0
|
|
|
|
|
|
$self->{'gfx'}->arc(@_); |
483
|
0
|
|
|
|
|
|
return $self; |
484
|
|
|
|
|
|
|
} |
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
=item $pdf->ellipse($xc,$yc, $rx,$ry) |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
Draw an ellipse centered at C[$xc,$yc], with x radius C[$rx] and y radius C[$ry]. |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
=cut |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
sub ellipse { |
493
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
494
|
|
|
|
|
|
|
|
495
|
0
|
|
|
|
|
|
$self->{'gfx'}->ellipse(@_); |
496
|
0
|
|
|
|
|
|
return $self; |
497
|
|
|
|
|
|
|
} |
498
|
|
|
|
|
|
|
|
499
|
|
|
|
|
|
|
=item $pdf->circle($xc,$yc, $r) |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
Draw a circle centered at C[$xc,$yc], of radius C[$r]. |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
=cut |
504
|
|
|
|
|
|
|
|
505
|
|
|
|
|
|
|
sub circle { |
506
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
507
|
|
|
|
|
|
|
|
508
|
0
|
|
|
|
|
|
$self->{'gfx'}->circle(@_); |
509
|
0
|
|
|
|
|
|
return $self; |
510
|
|
|
|
|
|
|
} |
511
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
=item $pdf->rect($x,$y, $w,$h) |
513
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
Draw a rectangle with lower left corner at C[$x,$y], width (+x) C[$w] and |
515
|
|
|
|
|
|
|
height (+y) C[$h]. |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
=cut |
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
sub rect { # x,y, w,h ... |
520
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
521
|
|
|
|
|
|
|
|
522
|
0
|
|
|
|
|
|
$self->{'gfx'}->rect(@_); |
523
|
0
|
|
|
|
|
|
return $self; |
524
|
|
|
|
|
|
|
} |
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
=item $pdf->rectxy($x1,$y1, $x2,$y2) |
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
Draw a rectangle with opposite corners C[$x1,$y1] and C[$x2,$y2]. |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
=cut |
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
sub rectxy { |
533
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
534
|
|
|
|
|
|
|
|
535
|
0
|
|
|
|
|
|
$self->{'gfx'}->rectxy(@_); |
536
|
0
|
|
|
|
|
|
return $self; |
537
|
|
|
|
|
|
|
} |
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
=item $pdf->poly($x1,$y1, ..., $xn,$yn) |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
Draw a polyline (multiple line segments) starting at (I to) C[$x1,$y1] and |
542
|
|
|
|
|
|
|
continuing on to C[$x2,$y2], ..., C[$xn,$yn]. |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
=cut |
545
|
|
|
|
|
|
|
|
546
|
|
|
|
|
|
|
sub poly { |
547
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
548
|
|
|
|
|
|
|
|
549
|
0
|
|
|
|
|
|
$self->{'gfx'}->poly(@_); |
550
|
0
|
|
|
|
|
|
return $self; |
551
|
|
|
|
|
|
|
} |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
=item $pdf->close() |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
Close a shape (draw a line back to the beginning). |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
=cut |
558
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
sub close { |
560
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
561
|
|
|
|
|
|
|
|
562
|
0
|
|
|
|
|
|
$self->{'gfx'}->close(); |
563
|
0
|
|
|
|
|
|
return $self; |
564
|
|
|
|
|
|
|
} |
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
=item $pdf->stroke() |
567
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
Stroke (actually draw) a shape whose path has already been laid out, using |
569
|
|
|
|
|
|
|
the requested C. |
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
=cut |
572
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
sub stroke { |
574
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
575
|
|
|
|
|
|
|
|
576
|
0
|
|
|
|
|
|
$self->{'gfx'}->stroke(); |
577
|
0
|
|
|
|
|
|
return $self; |
578
|
|
|
|
|
|
|
} |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
=item $pdf->fill() |
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
Fill in a closed geometry (path), using the requested C. |
583
|
|
|
|
|
|
|
The I is used if the path crosses itself. |
584
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
=cut |
586
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
sub fill { # nonzero winding rule |
588
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
589
|
|
|
|
|
|
|
|
590
|
0
|
|
|
|
|
|
$self->{'gfx'}->fill(); |
591
|
0
|
|
|
|
|
|
return $self; |
592
|
|
|
|
|
|
|
} |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
=item $pdf->fillstroke() |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
Fill (using C) I stroke (using C) a closed path. |
597
|
|
|
|
|
|
|
The I is used if the path crosses itself. |
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
=cut |
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
sub fillstroke { # nonzero winding rule |
602
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
603
|
|
|
|
|
|
|
|
604
|
0
|
|
|
|
|
|
$self->{'gfx'}->fillstroke(); |
605
|
0
|
|
|
|
|
|
return $self; |
606
|
|
|
|
|
|
|
} |
607
|
|
|
|
|
|
|
|
608
|
|
|
|
|
|
|
=item $pdf->image($imgobj, $x,$y, $w,$h) |
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
=item $pdf->image($imgobj, $x,$y, $scale) |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
=item $pdf->image($imgobj, $x,$y) |
613
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
B The width/height or scale given |
615
|
|
|
|
|
|
|
is in user-space coordinates, which are subject to |
616
|
|
|
|
|
|
|
transformations which may have been specified beforehand. |
617
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
Per default this has a 72dpi resolution, so if you want an |
619
|
|
|
|
|
|
|
image to have a 150 or 300dpi resolution, you should specify |
620
|
|
|
|
|
|
|
a scale of 72/150 (or 72/300) or adjust width/height accordingly. |
621
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
=cut |
623
|
|
|
|
|
|
|
|
624
|
|
|
|
|
|
|
sub image { |
625
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
626
|
|
|
|
|
|
|
|
627
|
0
|
|
|
|
|
|
$self->{'gfx'}->image(@_); |
628
|
0
|
|
|
|
|
|
return $self; |
629
|
|
|
|
|
|
|
} |
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
=item $pdf->textstart() |
632
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
Forces the start of text mode while in graphics. |
634
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
=cut |
636
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
sub textstart { |
638
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
639
|
|
|
|
|
|
|
|
640
|
0
|
|
|
|
|
|
$self->{'gfx'}->textstart(); |
641
|
0
|
|
|
|
|
|
return $self; |
642
|
|
|
|
|
|
|
} |
643
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
=item $pdf->textfont($fontobj, $size) |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
Define the current font to be an (already defined) font object at the given size. |
647
|
|
|
|
|
|
|
|
648
|
|
|
|
|
|
|
=cut |
649
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
sub textfont { |
651
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
652
|
|
|
|
|
|
|
|
653
|
0
|
|
|
|
|
|
$self->{'gfx'}->font(@_); |
654
|
0
|
|
|
|
|
|
return $self; |
655
|
|
|
|
|
|
|
} |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
=item $txt->textleading($leading) |
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
Set the baseline-to-baseline "leading" to be used for text lines. |
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
=item $txt->textlead($leading) |
662
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
Set the baseline-to-baseline "leading" to be used for text lines. |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
B will be removed March 2023 or later. Use textleading(). |
666
|
|
|
|
|
|
|
|
667
|
|
|
|
|
|
|
=cut |
668
|
|
|
|
|
|
|
|
669
|
|
|
|
|
|
|
# remove on or after March 2023 |
670
|
|
|
|
|
|
|
sub textlead { |
671
|
0
|
|
|
0
|
1
|
|
return $_[0]->textleading($_[1]); |
672
|
|
|
|
|
|
|
} |
673
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
sub textleading { |
675
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
676
|
|
|
|
|
|
|
|
677
|
0
|
|
|
|
|
|
$self->{'gfx'}->leading(@_); |
678
|
0
|
|
|
|
|
|
return $self; |
679
|
|
|
|
|
|
|
} |
680
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
=item $pdf->text($string) |
682
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
Applies (writes out) the given text at the current text location, using the |
684
|
|
|
|
|
|
|
already-specified font. |
685
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
=cut |
687
|
|
|
|
|
|
|
|
688
|
|
|
|
|
|
|
sub text { |
689
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
690
|
|
|
|
|
|
|
|
691
|
0
|
|
0
|
|
|
|
return $self->{'gfx'}->text(@_) || $self; |
692
|
|
|
|
|
|
|
} |
693
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
=item $pdf->nl() |
695
|
|
|
|
|
|
|
|
696
|
|
|
|
|
|
|
Write a newline (drop down to the next line). |
697
|
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
=cut |
699
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
sub nl { |
701
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
702
|
|
|
|
|
|
|
|
703
|
0
|
|
|
|
|
|
$self->{'gfx'}->nl(); |
704
|
0
|
|
|
|
|
|
return $self; |
705
|
|
|
|
|
|
|
} |
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
=item $pdf->textend() |
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
Force an end to text output and return to graphics. |
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
=cut |
712
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
sub textend { |
714
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
715
|
|
|
|
|
|
|
|
716
|
0
|
|
|
|
|
|
$self->{'gfx'}->textend(); |
717
|
0
|
|
|
|
|
|
return $self; |
718
|
|
|
|
|
|
|
} |
719
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
=item $pdf->print($font, $size, $x,$y, $rot, $just, $text) |
721
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
Convenience wrapper for shortening the textstart..textend sequence. |
723
|
|
|
|
|
|
|
|
724
|
|
|
|
|
|
|
Go into text mode, set the font to the object and size, go to the location, |
725
|
|
|
|
|
|
|
set any rotation, set justification, and write the array of text. |
726
|
|
|
|
|
|
|
Justification is 0 for left, 1 for center, and 2 for right. |
727
|
|
|
|
|
|
|
|
728
|
|
|
|
|
|
|
=cut |
729
|
|
|
|
|
|
|
|
730
|
|
|
|
|
|
|
sub print { |
731
|
0
|
|
|
0
|
1
|
|
my $self = shift(); |
732
|
0
|
|
|
|
|
|
my ($font, $size, $x,$y, $rot, $just, @text) = @_; |
733
|
|
|
|
|
|
|
|
734
|
0
|
|
|
|
|
|
my $text = join(' ', @text); |
735
|
0
|
|
|
|
|
|
$self->textstart(); |
736
|
0
|
|
|
|
|
|
$self->textfont($font, $size); |
737
|
0
|
|
|
|
|
|
$self->transform( |
738
|
|
|
|
|
|
|
'translate' => [$x, $y], |
739
|
|
|
|
|
|
|
'rotate' => $rot, |
740
|
|
|
|
|
|
|
); |
741
|
0
|
0
|
|
|
|
|
if ($just==1) { |
|
|
0
|
|
|
|
|
|
742
|
0
|
|
|
|
|
|
$self->{'gfx'}->text_center($text); |
743
|
|
|
|
|
|
|
} elsif ($just==2) { |
744
|
0
|
|
|
|
|
|
$self->{'gfx'}->text_right($text); |
745
|
|
|
|
|
|
|
} else { |
746
|
0
|
|
|
|
|
|
$self->text(@text); |
747
|
|
|
|
|
|
|
} |
748
|
0
|
|
|
|
|
|
$self->textend(); |
749
|
0
|
|
|
|
|
|
return $self; |
750
|
|
|
|
|
|
|
} |
751
|
|
|
|
|
|
|
|
752
|
|
|
|
|
|
|
1; |
753
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
__END__ |