1Prima::PS::Drawable(3)User Contributed Perl DocumentationPrima::PS::Drawable(3)
2
3
4

NAME

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

SYNOPSIS

9               use Prima;
10               use Prima::PS::Drawable;
11
12               my $x = Prima::PS::Drawable-> create( onSpool => sub {
13                       open F, ">> ./test.ps";
14                       print F $_[1];
15                       close F;
16               });
17               die "error:$@" unless $x-> begin_doc;
18               $x-> font-> size( 30);
19               $x-> text_out( "hello!", 100, 100);
20               $x-> end_doc;
21

DESCRIPTION

23       Realizes the Prima library interface to PostScript level 2 document
24       language.  The module is designed to be compliant with Prima::Drawable
25       interface.  All properties' behavior is as same as Prima::Drawable's,
26       except those described below.
27
28   Inherited properties
29       ::resolution
30           Can be set while object is in normal stage - cannot be changed if
31           document is opened. Applies to fillPattern realization and general
32           pixel-to-point and vice versa calculations
33
34       ::region
35           - ::region is not realized ( yet?)
36
37   Specific properties
38       ::copies
39           amount of copies that PS interpreter should print
40
41       ::grayscale
42           could be 0 or 1
43
44       ::pageSize
45           physical page dimension, in points
46
47       ::pageMargins
48           non-printable page area, an array of 4 integers: left, bottom,
49           right and top margins in points.
50
51       ::reversed
52           if 1, a 90 degrees rotated document layout is assumed
53
54       ::rotate and ::scale
55           along with Prima::Drawable::translate provide PS-specific
56           transformation matrix manipulations. ::rotate is number, measured
57           in degrees, counter-clockwise. ::scale is array of two numbers,
58           respectively x- and y-scale. 1 is 100%, 2 is 200% etc.
59
60       ::useDeviceFonts
61           1 by default; optimizes greatly text operations, but takes the risk
62           that a character could be drawn incorrectly or not drawn at all -
63           this behavior depends on a particular PS interpreter.
64
65       ::useDeviceFontsOnly
66           If 1, the system fonts, available from Prima::Application
67           interfaces can not be used. It is designed for developers and the
68           outside-of-Prima applications that wish to use PS generation module
69           without graphics. If 1, "::useDeviceFonts" is set to 1
70           automatically.
71
72           Default value is 0
73
74   Internal methods
75       emit
76           Can be called for direct PostScript code injection. Example:
77
78                   $x-> emit('0.314159 setgray');
79                   $x-> bar( 10, 10, 20, 20);
80
81       pixel2point and point2pixel
82           Helpers for translation from pixel to points and vice versa.
83
84       fill & stroke
85           Wrappers for PS outline that is expected to be filled or stroked.
86           Apply colors, line and fill styles if necessary.
87
88       spool
89           Prima::PS::Drawable is not responsible for output of generated
90           document, it just calls ::spool when document is closed through
91           ::end_doc. By default just skips data.  Prima::PS::Printer handles
92           spooling logic.
93
94       fonts
95           Returns Prima::Application::font plus those that defined into
96           Prima::PS::Fonts module.
97
98
99
100perl v5.30.1                      2020-01-30            Prima::PS::Drawable(3)
Impressum