1Prima::PS::PostScript(3U)ser Contributed Perl DocumentatiPornima::PS::PostScript(3)
2
3
4
6 Prima::PS::PostScript - PostScript interface to Prima::Drawable
7
9 use Prima;
10 use Prima::PS::PostScript;
11
12 my $x = Prima::PS::PostScript-> 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
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 Internal methods
61 emit
62 Can be called for direct PostScript code injection. Example:
63
64 $x-> emit('0.314159 setgray');
65 $x-> bar( 10, 10, 20, 20);
66
67 pixel2point and point2pixel
68 Helpers for translation from pixel to points and vice versa.
69
70 fill & stroke
71 Wrappers for PS outline that is expected to be filled or stroked.
72 Apply colors, line and fill styles if necessary.
73
74 spool
75 Prima::PS::PostScript is not responsible for output of generated
76 document, it just calls ::spool when document is closed through
77 ::end_doc. By default just skips data. Prima::PS::Printer handles
78 spooling logic.
79
80 fonts
81 Returns Prima::Application::fonts, however with "iso10646-1"
82 encoding only. That effectively allows only unicode output.
83
84
85
86perl v5.32.1 2021-01-27 Prima::PS::PostScript(3)