| 1 | #! /usr/bin/perl | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | package PostScript::Simple::EPS; | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 7 | ▶ | use Exporter; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 7 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 7 | ▶ | use PostScript::Simple; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 7 | ▶ | use vars qw($VERSION @ISA @EXPORT); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 7 | @ISA = qw(Exporter); | |||||||||||||||||||||||||||
| 13 | 7 | @EXPORT = qw(); | |||||||||||||||||||||||||||
| 14 | 7 | $VERSION = "0.02"; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | =head1 NAME | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | PostScript::Simple::EPS - EPS support for PostScript::Simple | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | use PostScript::Simple; | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | # create a new PostScript object | ||||||||||||||||||||||||||||
| 28 | $p = new PostScript::Simple(papersize => "A4", | ||||||||||||||||||||||||||||
| 29 | colour => 1, | ||||||||||||||||||||||||||||
| 30 | units => "in"); | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | # create a new page | ||||||||||||||||||||||||||||
| 33 | $p->newpage; | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | # add an eps file | ||||||||||||||||||||||||||||
| 36 | $p->add_eps({xsize => 3}, "test.eps", 1,1); | ||||||||||||||||||||||||||||
| 37 | $p->add_eps({yscale => 1.1, xscale => 1.8}, "test.eps", 4,8); | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | # create an eps object | ||||||||||||||||||||||||||||
| 40 | $e = new PostScript::Simple::EPS(file => "test.eps"); | ||||||||||||||||||||||||||||
| 41 | $e->rotate(90); | ||||||||||||||||||||||||||||
| 42 | $e->xscale(0.5); | ||||||||||||||||||||||||||||
| 43 | $p->add_eps($e, 3, 3); # add eps object to postscript object | ||||||||||||||||||||||||||||
| 44 | $e->xscale(2); | ||||||||||||||||||||||||||||
| 45 | $p->add_eps($e, 2, 5); # add eps object to postscript object again | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | # write the output to a file | ||||||||||||||||||||||||||||
| 48 | $p->output("file.ps"); | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | PostScript::Simple::EPS allows you to add EPS files into PostScript::Simple | ||||||||||||||||||||||||||||
| 54 | objects. Included EPS files can be scaled and rotated, and placed anywhere | ||||||||||||||||||||||||||||
| 55 | inside a PostScript::Simple page. | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | Remember when using translate/scale/rotate that you will normally need to do | ||||||||||||||||||||||||||||
| 58 | the operations in the reverse order to that which you expect. | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | =head1 PREREQUISITES | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | This module requires C<PostScript::Simple>, C<strict>, C<Carp> and C<Exporter>. | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | =head2 EXPORT | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | None. | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | =cut | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | =head1 CONSTRUCTOR | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | =over 4 | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | =item C<new(options)> | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | Create a new PostScript::Simple::EPS object. The options | ||||||||||||||||||||||||||||
| 77 | that can be set are: | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | =over 4 | ||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | =item file | ||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | EPS file to be included. This or C<source> must exist when the C<new> method is | ||||||||||||||||||||||||||||
| 84 | called. | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | =item source | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | PostScript code for the EPS document. Either this or C<file> must be set when | ||||||||||||||||||||||||||||
| 89 | C<new> is called. | ||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | =item clip | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | Set to 0 to disable clipping to the EPS bounding box. Default is to clip. | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | =back | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | Example: | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | $ps = new PostScript::Simple(landscape => 1, | ||||||||||||||||||||||||||||
| 100 | eps => 0, | ||||||||||||||||||||||||||||
| 101 | xsize => 4, | ||||||||||||||||||||||||||||
| 102 | ysize => 3, | ||||||||||||||||||||||||||||
| 103 | units => "in"); | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | $eps = new PostScript::Simple::EPS(file => "test.eps"); | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | $eps->scale(0.5); | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | Scale the EPS file by x0.5 in both directions. | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | $ps->newpage(); | ||||||||||||||||||||||||||||
| 112 | $ps->importeps($eps, 1, 1); | ||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | Add the EPS file to the PostScript document at coords (1,1). | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | $ps->importepsfile("another.eps", 1, 2, 4, 4); | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | Easily add an EPS file to the PostScript document using bounding box (1,2),(4,4). | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | The methods C<importeps> and C<importepsfile> are described in the documentation | ||||||||||||||||||||||||||||
| 121 | of C<PostScript::Simple>. | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | =back | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | =cut | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | sub new | ||||||||||||||||||||||||||||
| 128 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 129 | 0 | my ($class, %data) = @_; | |||||||||||||||||||||||||||
| 130 | 0 | my $self = { | |||||||||||||||||||||||||||
| 131 | file => undef, # filename of the eps file | ||||||||||||||||||||||||||||
| 132 | xsize => undef, | ||||||||||||||||||||||||||||
| 133 | ysize => undef, | ||||||||||||||||||||||||||||
| 134 | units => "bp", # measuring units (see below) | ||||||||||||||||||||||||||||
| 135 | clip => 1, # clip to the bounding box | ||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||
| 137 | bbx1 => 0, # Bounding Box definitions | ||||||||||||||||||||||||||||
| 138 | bby1 => 0, | ||||||||||||||||||||||||||||
| 139 | bbx2 => 0, | ||||||||||||||||||||||||||||
| 140 | bby2 => 0, | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | epsprefix => [], | ||||||||||||||||||||||||||||
| 143 | epsfile => undef, | ||||||||||||||||||||||||||||
| 144 | epspostfix => [], | ||||||||||||||||||||||||||||
| 145 | }; | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | 0 | foreach (keys %data) | |||||||||||||||||||||||||||
| 148 | { | ||||||||||||||||||||||||||||
| 149 | 0 | $self->{$_} = $data{$_}; | |||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||
| 152 | 0 | ▶ | if ((!defined $self->{"file"}) && (!defined $self->{"source"})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->{"file"} or defined $self->{"source"}
MC/DC0%0/2
defined $self->{"file"} or defined $self->{"source"}
defined $self->{"file"}
defined $self->{"source"}
Truth table0%0/3
A or B
A= defined $self->{"file"}B= defined $self->{"source"}
| |||||||||||||||||||||||||||||
| 153 | 0 | croak "must provide file or source"; | |||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||
| 155 | 0 | ▶ | if ((defined $self->{"file"}) && (defined $self->{"source"})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->{"file"} and defined $self->{"source"}
MC/DC0%0/2
defined $self->{"file"} and defined $self->{"source"}
defined $self->{"file"}
defined $self->{"source"}
Truth table0%0/3
A and B
A= defined $self->{"file"}B= defined $self->{"source"}
| |||||||||||||||||||||||||||||
| 156 | 0 | croak "cannot provide both file and source"; | |||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | 0 | bless $self, $class; | |||||||||||||||||||||||||||
| 160 | 0 | $self->init(); | |||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | 0 | return $self; | |||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||
| 168 | sub init | ||||||||||||||||||||||||||||
| 169 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 170 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 171 | 0 | my $foundbbx = 0; | |||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | 0 | ▶ | if (defined($$self{source})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 174 | 0 | ▶ | croak "EPS file must contain a BoundingBox" if (!$self->_getsourcebbox()); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 175 | } else { | ||||||||||||||||||||||||||||
| 176 | 0 | ▶ | croak "EPS file must contain a BoundingBox" if (!_getfilebbox($self)); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||
| 179 | 0 | ▶ | if (($$self{bbx2} - $$self{bbx1} == 0) || | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"bbx2"} - $self->{"bbx1"} == 0 or $self->{"bby2"} - $self->{"bby1"} == 0
MC/DC0%0/2
$self->{"bbx2"} - $self->{"bbx1"} == 0 or $self->{"bby2"} - $self->{"bby1"} == 0
$self->{"bbx2"} - $self->{"bbx1"} == 0
$self->{"bby2"} - $self->{"bby1"} == 0
Truth table0%0/3
A or B
A= $self->{"bbx2"} - $self->{"bbx1"} == 0B= $self->{"bby2"} - $self->{"bby1"} == 0
| |||||||||||||||||||||||||||||
| 180 | ($$self{bby2} - $$self{bby1} == 0)) { | ||||||||||||||||||||||||||||
| 181 | 0 | $self->_error("PostScript::Simple::EPS: Bounding Box has zero dimension"); | |||||||||||||||||||||||||||
| 182 | 0 | return 0; | |||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||
| 185 | 0 | $self->reset(); | |||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||
| 187 | 0 | return 1; | |||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | =head1 OBJECT METHODS | ||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||
| 195 | All object methods return 1 for success or 0 in some error condition | ||||||||||||||||||||||||||||
| 196 | (e.g. insufficient arguments). Error message text is also drawn on | ||||||||||||||||||||||||||||
| 197 | the page. | ||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | =over 4 | ||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||
| 201 | =item C<get_bbox> | ||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||
| 203 | Returns the EPS bounding box, as specified on the %%BoundingBox line | ||||||||||||||||||||||||||||
| 204 | of the EPS file. Units are standard PostScript points. | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | Example: | ||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||
| 208 | ($x1, $y1, $x2, $y2) = $eps->get_bbox(); | ||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||
| 210 | =cut | ||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||
| 212 | sub get_bbox | ||||||||||||||||||||||||||||
| 213 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
get_bbox: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 214 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | 0 | return ($$self{bbx1}, $$self{bby1}, $$self{bbx2}, $$self{bby2}); | |||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||
| 220 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | =item C<width> | ||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 224 | Returns the EPS width, in PostScript points. | ||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | Example: | ||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||
| 228 | print "EPS width is " . abs($eps->width()) . "\n"; | ||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||
| 230 | =cut | ||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | sub width | ||||||||||||||||||||||||||||
| 233 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
width: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 234 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||
| 236 | 0 | return ($$self{bbx2} - $$self{bbx1}); | |||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||
| 240 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||
| 242 | =item C<height> | ||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||
| 244 | Returns the EPS height, in PostScript points. | ||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||
| 246 | Example: | ||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | To scale $eps to 72 points high, do: | ||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||
| 250 | $eps->scale(1, 72/$eps->height()); | ||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||
| 252 | =cut | ||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||
| 254 | sub height | ||||||||||||||||||||||||||||
| 255 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
height: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 256 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||
| 258 | 0 | return ($$self{bby2} - $$self{bby1}); | |||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||
| 262 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||
| 264 | =item C<scale(x, y)> | ||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||
| 266 | Scales the EPS file. To scale in one direction only, specify 1 as the | ||||||||||||||||||||||||||||
| 267 | other scale. To scale the EPS file the same in both directions, you | ||||||||||||||||||||||||||||
| 268 | may use the shortcut of just specifying the one value. | ||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||
| 270 | Example: | ||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||
| 272 | $eps->scale(1.2, 0.8); # make wider and shorter | ||||||||||||||||||||||||||||
| 273 | $eps->scale(0.5); # shrink to half size | ||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||
| 275 | =cut | ||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||
| 277 | sub scale | ||||||||||||||||||||||||||||
| 278 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
scale: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 279 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 280 | 0 | my ($x, $y) = @_; | |||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||
| 282 | 0 | ▶ | $y = $x if (!defined $y); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 283 | 0 | ▶ | croak "bad arguments to scale" if (!defined $x); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||
| 285 | 0 | push @{$$self{epsprefix}}, "$x $y scale"; | |||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||
| 287 | 0 | return 1; | |||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||
| 291 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||
| 293 | =item C<rotate(deg)> | ||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||
| 295 | Rotates the EPS file by C<deg> degrees anti-clockwise. The EPS file is rotated | ||||||||||||||||||||||||||||
| 296 | about it's own origin (as defined by it's bounding box). To rotate by a particular | ||||||||||||||||||||||||||||
| 297 | co-ordinate (again, relative to the EPS file, not the main PostScript document), | ||||||||||||||||||||||||||||
| 298 | use translate, too. | ||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||
| 300 | Example: | ||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||
| 302 | $eps->rotate(180); # turn upside-down | ||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||
| 304 | To rotate 30 degrees about point (50,50): | ||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||
| 306 | $eps->translate(50, 50); | ||||||||||||||||||||||||||||
| 307 | $eps->rotate(30); | ||||||||||||||||||||||||||||
| 308 | $eps->translate(-50, -50); | ||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||
| 310 | =cut | ||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||
| 312 | sub rotate | ||||||||||||||||||||||||||||
| 313 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
rotate: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 314 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 315 | 0 | my ($d) = @_; | |||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||
| 317 | 0 | ▶ | croak "bad arguments to rotate" if (!defined $d); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||
| 319 | 0 | push @{$$self{epsprefix}}, "$d rotate"; | |||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||
| 321 | 0 | return 1; | |||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||
| 325 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||
| 327 | =item C<translate(x, y)> | ||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||
| 329 | Move the EPS file by C<x>,C<y> PostScript points. | ||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||
| 331 | Example: | ||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||
| 333 | $eps->translate(10, 10); # move 10 points in both directions | ||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||
| 335 | =cut | ||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||
| 337 | sub translate | ||||||||||||||||||||||||||||
| 338 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
translate: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 339 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 340 | 0 | my ($x, $y) = @_; | |||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||
| 342 | 0 | ▶ | croak "bad arguments to translate" if (!defined $y); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||
| 344 | 0 | push @{$$self{epsprefix}}, "$x $y translate"; | |||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||
| 346 | 0 | return 1; | |||||||||||||||||||||||||||
| 347 | } | ||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||
| 350 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||
| 352 | =item C<reset> | ||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||
| 354 | Clear all translate, rotate and scale operations. | ||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||
| 356 | Example: | ||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||
| 358 | $eps->reset(); | ||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||
| 360 | =cut | ||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||
| 362 | sub reset | ||||||||||||||||||||||||||||
| 363 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
reset: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 364 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||
| 366 | 0 | @{$$self{"epsprefix"}} = (); | |||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||
| 368 | 0 | return 1; | |||||||||||||||||||||||||||
| 369 | } | ||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||
| 371 | |||||||||||||||||||||||||||||
| 372 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||
| 374 | =item C<load> | ||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||
| 376 | Reads the EPS file into memory, to save reading it from file each time if | ||||||||||||||||||||||||||||
| 377 | inserted many times into a document. Can not be used with C<preload>. | ||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||
| 379 | =cut | ||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||
| 381 | sub load | ||||||||||||||||||||||||||||
| 382 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
load: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 383 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 384 | 0 | local *EPS; | |||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||
| 386 | 0 | ▶ | return 1 if (defined $$self{"epsfile"}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 387 | 0 | ▶ | return 1 if (defined $$self{"source"}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||
| 389 | 0 | $$self{"epsfile"} = "\%\%BeginDocument: ($$self{file})\n"; | |||||||||||||||||||||||||||
| 390 | 0 | ▶ | open EPS, "< $$self{file}" || croak "can't open eps file $$self{file}"; | ||||||||||||||||||||||||||
|
Condition0%0/2
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
MC/DC0%0/1
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
"< $self->{'file'}"
Truth table0%0/2
A
A= "< $self->{'file'}"
| |||||||||||||||||||||||||||||
| 391 | 0 | ▶ | while (<EPS>) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 392 | { | ||||||||||||||||||||||||||||
| 393 | 0 | $$self{"epsfile"} .= $_; | |||||||||||||||||||||||||||
| 394 | } | ||||||||||||||||||||||||||||
| 395 | 0 | close EPS; | |||||||||||||||||||||||||||
| 396 | 0 | $$self{"epsfile"} .= "\%\%EndDocument\n"; | |||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||
| 398 | 0 | return 1; | |||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||
| 402 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||
| 404 | =item C<preload(object)> | ||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||
| 406 | Experimental: defines the EPS at in the document prolog, and just runs a | ||||||||||||||||||||||||||||
| 407 | command to insert it each time it is used. C<object> is a PostScript::Simple | ||||||||||||||||||||||||||||
| 408 | object. If the EPS file is included more than once in the PostScript file then | ||||||||||||||||||||||||||||
| 409 | this will probably shrink the filesize quite a lot. | ||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||
| 411 | Can not be used at the same time as C<load>, or when using EPS objects defined | ||||||||||||||||||||||||||||
| 412 | from PostScript source. | ||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||
| 414 | Example: | ||||||||||||||||||||||||||||
| 415 | |||||||||||||||||||||||||||||
| 416 | $p = new PostScript::Simple(); | ||||||||||||||||||||||||||||
| 417 | $e = new PostScript::Simple::EPS(file => "test.eps"); | ||||||||||||||||||||||||||||
| 418 | $e->preload($p); | ||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||
| 420 | =cut | ||||||||||||||||||||||||||||
| 421 | |||||||||||||||||||||||||||||
| 422 | sub preload | ||||||||||||||||||||||||||||
| 423 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
preload: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||
| 424 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 425 | 0 | my $ps = shift; | |||||||||||||||||||||||||||
| 426 | 0 | my $randcode = ""; | |||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||
| 428 | 0 | ▶ | croak "already loaded" if (defined $$self{"epsfile"}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 429 | 0 | ▶ | croak "can't preload when using source" if (defined $$self{"source"}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||
| 431 | 0 | ▶ | croak "no PostScript::Simple module provided" if (!defined $ps); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||
| 433 | 0 | for my $i (0..7) | |||||||||||||||||||||||||||
| 434 | { | ||||||||||||||||||||||||||||
| 435 | 0 | $randcode .= chr(int(rand()*26)+65); # yuk | |||||||||||||||||||||||||||
| 436 | } | ||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||
| 438 | 0 | $$self{"epsfile"} = "eps$randcode\n"; | |||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||
| 440 | 0 | $$ps{"psprolog"} .= "/eps$randcode {\n"; | |||||||||||||||||||||||||||
| 441 | 0 | $$ps{"psprolog"} .= "\%\%BeginDocument: ($$self{file})\n"; | |||||||||||||||||||||||||||
| 442 | 0 | ▶ | open EPS, "< $$self{file}" || croak "can't open eps file $$self{file}"; | ||||||||||||||||||||||||||
|
Condition0%0/2
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
MC/DC0%0/1
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
"< $self->{'file'}"
Truth table0%0/2
A
A= "< $self->{'file'}"
| |||||||||||||||||||||||||||||
| 443 | 0 | ▶ | while (<EPS>) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 444 | { | ||||||||||||||||||||||||||||
| 445 | 0 | $$ps{"psprolog"} .= $_; | |||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||
| 447 | 0 | close EPS; | |||||||||||||||||||||||||||
| 448 | 0 | $$ps{"psprolog"} .= "\%\%EndDocument\n"; | |||||||||||||||||||||||||||
| 449 | 0 | $$ps{"psprolog"} .= "} def\n"; | |||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||
| 451 | 0 | return 1; | |||||||||||||||||||||||||||
| 452 | } | ||||||||||||||||||||||||||||
| 453 | |||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||
| 455 | ################################################################################ | ||||||||||||||||||||||||||||
| 456 | # PRIVATE methods | ||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||
| 458 | sub _getfilebbox | ||||||||||||||||||||||||||||
| 459 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_getfilebbox: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 460 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 461 | 0 | my $foundbbx = 0; | |||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||
| 463 | 0 | ▶ | return 0 if (!defined $$self{file}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 464 | 0 | ▶ | open EPS, "< $$self{file}" || croak "can't open eps file $$self{file}"; | ||||||||||||||||||||||||||
|
Condition0%0/2
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
MC/DC0%0/1
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
"< $self->{'file'}"
Truth table0%0/2
A
A= "< $self->{'file'}"
| |||||||||||||||||||||||||||||
| 465 | 0 | ▶ | SCAN: while (<EPS>) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 466 | { | ||||||||||||||||||||||||||||
| 467 | 0 | s/[\r\n]*$//; #ultimate chomp | |||||||||||||||||||||||||||
| 468 | 0 | ▶ | if (/^\%\%BoundingBox:\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)\s*$/) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 469 | { | ||||||||||||||||||||||||||||
| 470 | 0 | $$self{bbx1} = $1; | |||||||||||||||||||||||||||
| 471 | 0 | $$self{bby1} = $2; | |||||||||||||||||||||||||||
| 472 | 0 | $$self{bbx2} = $3; | |||||||||||||||||||||||||||
| 473 | 0 | $$self{bby2} = $4; | |||||||||||||||||||||||||||
| 474 | 0 | $foundbbx = 1; | |||||||||||||||||||||||||||
| 475 | 0 | last SCAN; | |||||||||||||||||||||||||||
| 476 | } | ||||||||||||||||||||||||||||
| 477 | } | ||||||||||||||||||||||||||||
| 478 | 0 | close EPS; | |||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||
| 480 | 0 | return $foundbbx; | |||||||||||||||||||||||||||
| 481 | } | ||||||||||||||||||||||||||||
| 482 | |||||||||||||||||||||||||||||
| 483 | |||||||||||||||||||||||||||||
| 484 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 485 | |||||||||||||||||||||||||||||
| 486 | sub _getsourcebbox | ||||||||||||||||||||||||||||
| 487 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_getsourcebbox: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 488 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 489 | |||||||||||||||||||||||||||||
| 490 | 0 | my $ref; | |||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||
| 492 | 0 | ▶ | $ref = \$self->{epsfile} if defined $self->{epsfile}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 493 | 0 | ▶ | $ref = \$self->{source} if defined $self->{source}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 494 | |||||||||||||||||||||||||||||
| 495 | 0 | ▶ | return 0 unless defined $$ref; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 496 | |||||||||||||||||||||||||||||
| 497 | 0 | ▶ | if ($$ref =~ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 498 | /^\%\%BoundingBox:\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)$/m) | ||||||||||||||||||||||||||||
| 499 | { | ||||||||||||||||||||||||||||
| 500 | 0 | $$self{bbx1} = $1; | |||||||||||||||||||||||||||
| 501 | 0 | $$self{bby1} = $2; | |||||||||||||||||||||||||||
| 502 | 0 | $$self{bbx2} = $3; | |||||||||||||||||||||||||||
| 503 | 0 | $$self{bby2} = $4; | |||||||||||||||||||||||||||
| 504 | 0 | return 1; | |||||||||||||||||||||||||||
| 505 | } | ||||||||||||||||||||||||||||
| 506 | |||||||||||||||||||||||||||||
| 507 | 0 | return 0; | |||||||||||||||||||||||||||
| 508 | } | ||||||||||||||||||||||||||||
| 509 | |||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||
| 511 | #------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||
| 513 | sub _get_include_data | ||||||||||||||||||||||||||||
| 514 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_get_include_data: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||
| 515 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 516 | 0 | my ($x, $y) = @_; | |||||||||||||||||||||||||||
| 517 | 0 | my $data = ""; | |||||||||||||||||||||||||||
| 518 | |||||||||||||||||||||||||||||
| 519 | 0 | ▶ | croak "argh... internal error (incorrect arguments)" if (scalar @_ != 2); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 520 | |||||||||||||||||||||||||||||
| 521 | 0 | foreach my $line (@{$$self{"epsprefix"}}) { | |||||||||||||||||||||||||||
| 522 | 0 | $data .= "$line\n"; | |||||||||||||||||||||||||||
| 523 | } | ||||||||||||||||||||||||||||
| 524 | |||||||||||||||||||||||||||||
| 525 | 0 | ▶ | if ($$self{"clip"}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 526 | 0 | $data .= "newpath $$self{bbx1} $$self{bby1} moveto | |||||||||||||||||||||||||||
| 527 | $$self{bbx2} $$self{bby1} lineto $$self{bbx2} $$self{bby2} lineto | ||||||||||||||||||||||||||||
| 528 | $$self{bbx1} $$self{bby2} lineto closepath clip newpath\n"; | ||||||||||||||||||||||||||||
| 529 | } | ||||||||||||||||||||||||||||
| 530 | |||||||||||||||||||||||||||||
| 531 | 0 | ▶ | if (defined $$self{"epsfile"}) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 532 | 0 | $data .= $$self{"epsfile"}; | |||||||||||||||||||||||||||
| 533 | } elsif (defined $$self{"source"}) { | ||||||||||||||||||||||||||||
| 534 | 0 | $data .= "\%\%BeginDocument: (undef)\n"; | |||||||||||||||||||||||||||
| 535 | 0 | $data .= $$self{"source"}; | |||||||||||||||||||||||||||
| 536 | 0 | $data .= "\%\%EndDocument\n"; | |||||||||||||||||||||||||||
| 537 | } else { | ||||||||||||||||||||||||||||
| 538 | 0 | $data .= "\%\%BeginDocument: ($$self{file})\n"; | |||||||||||||||||||||||||||
| 539 | 0 | ▶ | open EPS, "< $$self{file}" || croak "can't open eps file $$self{file}"; | ||||||||||||||||||||||||||
|
Condition0%0/2
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
MC/DC0%0/1
"< $self->{'file'}" || croak("can't open eps file $self->{'file'}")
"< $self->{'file'}"
Truth table0%0/2
A
A= "< $self->{'file'}"
| |||||||||||||||||||||||||||||
| 540 | 0 | ▶ | while (<EPS>) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 541 | 0 | $data .= $_; | |||||||||||||||||||||||||||
| 542 | } | ||||||||||||||||||||||||||||
| 543 | 0 | close EPS; | |||||||||||||||||||||||||||
| 544 | 0 | $data .= "\%\%EndDocument\n"; | |||||||||||||||||||||||||||
| 545 | } | ||||||||||||||||||||||||||||
| 546 | |||||||||||||||||||||||||||||
| 547 | 0 | foreach my $line (@{$$self{"epspostfix"}}) { | |||||||||||||||||||||||||||
| 548 | 0 | $data .= "$line\n"; | |||||||||||||||||||||||||||
| 549 | } | ||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||
| 551 | 0 | return $data; | |||||||||||||||||||||||||||
| 552 | } | ||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||
| 554 | sub _error | ||||||||||||||||||||||||||||
| 555 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
_error: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 556 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 557 | 0 | my $msg = shift; | |||||||||||||||||||||||||||
| 558 | 0 | $self->{pspages} .= "(error: $msg\n) print flush\n"; | |||||||||||||||||||||||||||
| 559 | } | ||||||||||||||||||||||||||||
| 560 | |||||||||||||||||||||||||||||
| 561 | |||||||||||||||||||||||||||||
| 562 | =back | ||||||||||||||||||||||||||||
| 563 | |||||||||||||||||||||||||||||
| 564 | =head1 BUGS | ||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||
| 566 | This is software in development; some current functionality may not be as | ||||||||||||||||||||||||||||
| 567 | expected, and/or may not work correctly. | ||||||||||||||||||||||||||||
| 568 | |||||||||||||||||||||||||||||
| 569 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 570 | |||||||||||||||||||||||||||||
| 571 | The PostScript::Simple::EPS module was written by Matthew Newton, after prods | ||||||||||||||||||||||||||||
| 572 | for such a feature from several people around the world. A useful importeps | ||||||||||||||||||||||||||||
| 573 | function that provides scaling and aspect ratio operations was gratefully | ||||||||||||||||||||||||||||
| 574 | received from Glen Harris, and merged into this module. | ||||||||||||||||||||||||||||
| 575 | |||||||||||||||||||||||||||||
| 576 | Copyright (C) 2002-2014 Matthew C. Newton | ||||||||||||||||||||||||||||
| 577 | |||||||||||||||||||||||||||||
| 578 | This program is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 579 | the terms of the GNU General Public License as published by the Free Software | ||||||||||||||||||||||||||||
| 580 | Foundation, version 2. | ||||||||||||||||||||||||||||
| 581 | |||||||||||||||||||||||||||||
| 582 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | ||||||||||||||||||||||||||||
| 583 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||||||||||||||||||||||||||||
| 584 | PARTICULAR PURPOSE. See the GNU General Public License for more details, | ||||||||||||||||||||||||||||
| 585 | available at http://www.gnu.org/licenses/gpl.html. | ||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||
| 587 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 588 | |||||||||||||||||||||||||||||
| 589 | L<PostScript::Simple> | ||||||||||||||||||||||||||||
| 590 | |||||||||||||||||||||||||||||
| 591 | =cut | ||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||
| 593 | 7 | 1; | |||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||
| 595 | # vim:foldmethod=marker: | ||||||||||||||||||||||||||||