The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Prima::PS::Drawable - PostScript interface to Prima::Drawable

SYNOPSIS

   use Prima;
   use Prima::PS::Drawable;

   package FileSpoolPrinter;
   use vars qw(@ISA);
   @ISA = qw(Prima::PS::Drawable);

   sub spool {
      open F, "> ./test.ps";
      print F ($_, "\n") for @{$_[1]};
      close F;
   }
   
   my $x = FileSpoolPrinter-> create;
   $x-> begin_doc;
   $x-> font-> size( 30);
   $x-> text_out( "hello!", 100, 100);
   $x-> end_doc;

DESCRIPTION

Realizes the Prima library interface to PostScript level 2 document language. The module is designed to be compliant with Prima::Drawable interface. All properties' behavior is as same as Prima::Drawable's, except those described below.

::resolution

Can be set while object is in normal stage - cannot be changed if document is opened. Applies to fillPattern realization and general pixel-to-point and vice versa calculations

::region

- ::region is not realized ( yet?)

Specific properties

::copies

amount of copies that PS interpreter should print

::grayscale

could be 0 or 1

::locale

used by default for optimized text operations. Not used if ::useDeviceFonts is 0.

::pageSize

physical page dimension, in points

::pageMargins

non-printable page area, an array of 4 integers: left, bottom, right and top margins in points.

::reversed

if 1, a 90 degrees rotated document layout is assumed

::rotate and ::scale

along with Prima::Drawable::translate provide PS-specific transformation matrix manipulations. ::rotate is number, measured in degrees, counter-clockwise. ::scale is array of two numbers, respecively x- and y-scale. 1 is 100%, 2 is 200% etc.

::useDeviceFonts

1 by default; optimizes greatly text operaions, but takes the risk that a character could be drawn incorrectly or not drawn at all - thsi behavior depends on a particular PS interpreter.

Internal routines

emit

Can be called for direct PostScript code injection. Example:

  $x-> emit('0.314159 setgray');
  $x-> bar( 10, 10, 20, 20);
pixel2point and point2pixel

Helpers for transformation from pixel to points and vice versa.

fill and stroke

Wrappers for PS outline that is expected to be filled or stroked. Apply colors, line and fill styles if necessary.

spool

Prima::PS::Drawable is not responsible for output of generated document, it just calls ::spool when document is closed through ::end_doc. By default just skips data. Prima::PS::Printer handles spooling logic.

fonts

Returns Prima::Application::font plus those that defined into Prima::PS::Fonts module.

5 POD Errors

The following errors were encountered while parsing the POD:

Around line 71:

'=item' outside of any '=over'

Around line 81:

You forgot a '=back' before '=head2'

Around line 83:

'=item' outside of any '=over'

Around line 186:

You forgot a '=back' before '=head2'

Around line 188:

'=item' outside of any '=over'

=over without closing =back