NAME

PostScript::Easy - Produce PostScript files from Perl

SYNOPSIS

use PostScript::Easy;


# create a new PostScript object
$p = new PostScript::Easy(papersize => "A4",
                            colour => 1,
                            eps => 0,
                            units => "in");


# create a new page
$p->newpage;


# draw some lines and other shapes
$p->line(1,1, 1,4);
$p->linextend(2,4);
$p->box(1.5,1, 2,3.5);
$p->circle(2,2, 1);
$p->setlinewidth( 0.01 );
$p->curve(1,5, 1,7, 3,7, 3,5);
$p->curvextend(3,3, 5,3, 5,5);


# draw a rotated polygon in a different colour
$p->setcolour(0,100,200);
$p->polygon({rotate=>45}, 1,1, 1,2, 2,2, 2,1, 1,1);


# add some text in red
$p->setcolour("red");
$p->setfont("Times-Roman", 20);
$p->text(1,1, "Hello");


# write the output to a file
$p->output("file.ps");

DESCRIPTION

PostScript::Easy was forked from PostScript::Simple v0.07. And, basic usage is the same to PostScript::Simple.

PostScript::Easy allows you to have a simple method of writing PostScript files from Perl. It has graphics primitives that allow lines, curves, circles, polygons and boxes to be drawn. Text can be added to the page using standard PostScript fonts.

The images can be single page EPS files, or multipage PostScript files. The image size can be set by using a recognised paper size ("A4", for example) or by giving dimensions. The units used can be specified ("mm" or "in", etc) and are the same as those used in TeX. The default unit is a bp, or a PostScript point, unlike TeX.

PREREQUISITES

This module requires strict and Exporter.

EXPORT

None.

CONSTRUCTOR

OBJECT METHODS

All object methods return 1 for success or 0 in some error condition (e.g. insufficient arguments). Error message text is also drawn on the page.

BUGS

Some current functionality may not be as expected, and/or may not work correctly. That's the fun with using code in development!

AUTHOR

Satoshi Azuma ["ytnobody at gmail dot com"](#ytnobody at gmail dot com)

The Original PostScript::Simple module was created by Matthew Newton, with ideas and suggestions from Mark Withall and many other people from around the world. Thanks!

Please see the README file in the distribution for more information about contributors.

Copyright (C) 2002-2003 Matthew C. Newton / Newton Computing

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, available at http://www.gnu.org/licenses/gpl.html.

SEE ALSO

PostScript::Easy::EPS