1Prima::PS::PDF(3) User Contributed Perl Documentation Prima::PS::PDF(3)
2
3
4
6 Prima::PS::PDF - PDF interface to Prima::Drawable
7
9 use Prima;
10 use Prima::PS::PDF;
11
12 my $x = Prima::PS::PDF-> create( onSpool => sub {
13 open F, ">> ./test.pdf";
14 binmode F;
15 print F $_[1];
16 close F;
17 });
18 die "error:$@" unless $x-> begin_doc;
19 $x-> font-> size( 30);
20 $x-> text_out( "hello!", 100, 100);
21 $x-> end_doc;
22
24 Realizes the Prima library interface to PDF v1.4. The module is
25 designed to be compliant with Prima::Drawable interface. All
26 properties' behavior is as same as Prima::Drawable's, except those
27 described below.
28
29 Inherited properties
30 ::resolution
31 Can be set while object is in normal stage - cannot be changed if
32 document is opened. Applies to fillPattern realization and general
33 pixel-to-point and vice versa calculations
34
35 Specific properties
36 ::grayscale
37 could be 0 or 1
38
39 ::pageSize
40 physical page dimension, in points
41
42 ::pageMargins
43 non-printable page area, an array of 4 integers: left, bottom,
44 right and top margins in points.
45
46 ::reversed
47 if 1, a 90 degrees rotated document layout is assumed
48
49 ::rotate and ::scale
50 along with Prima::Drawable::translate provide PS-specific
51 transformation matrix manipulations. ::rotate is number, measured
52 in degrees, counter-clockwise. ::scale is array of two numbers,
53 respectively x- and y-scale. 1 is 100%, 2 is 200% etc.
54
55 Internal methods
56 pixel2point and point2pixel
57 Helpers for translation from pixel to points and vice versa.
58
59 spool
60 Prima::PS::Drawable is not responsible for output of generated
61 document, it just calls ::spool when document is closed through
62 ::end_doc. By default just skips data. Prima::PS::Printer handles
63 spooling logic.
64
65 fonts
66 Returns Prima::Application::fonts, however with "iso10646-1"
67 encoding only. That effectively allows only unicode output.
68
69
70
71perl v5.34.1 2022-04-20 Prima::PS::PDF(3)