File: Constants.pm

package info (click to toggle)
libpdf-fromhtml-perl 0.34-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 576 kB
  • sloc: perl: 4,876; makefile: 15
file content (99 lines) | stat: -rw-r--r-- 2,329 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package PDF::FromHTML::Template::Constants;

use strict;

BEGIN {
    use Exporter ();

    use vars qw(@ISA @EXPORT_OK);

    @ISA = qw(Exporter);

    @EXPORT_OK = qw(
        %PointsPer
        %Verify
    );
}

# This is a list of conversions from various units of measure to points.
# The key will be the first letter of the unit.
our %PointsPer = (
    I => 72.27,    # Inches
    P => 1,        # Points
);
$PointsPer{C} = ($PointsPer{I} / 2.54); # Centimeters

#GGG Add:
#    PDFTemplate properties (to go with %NoSetProperty)

our %Verify = (

#GGG This also needs improvement ... Not all available fonts are listed
    'FACE' => {
        '__DEFAULT__' => 'Times-Bold',
        ( map { $_ => 1 } qw(
            Courier Courier-Bold Courier-Oblique Courier-BoldOblique
            Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique
            Times-Roman Times-Bold Times-Italic Times-BoldItalic
            Symbol ZapfDingbats
        )),
    },

    'ALIGN' => {
        '__DEFAULT__' => 'left',
#GGG Add a full-justify option - this requires a lot of coding prowess
        ( map { $_ => 1 } qw(
            center left right
        )),
    },

    'OPENACTION' => {
        '__DEFAULT__' => 'fitpage',
        ( map { $_ => 1 } qw(
            fitbox fitheight fitpage fitwidth retain
        )),
    },

    'OPENMODE' => {
        '__DEFAULT__' => 'none',
        ( map { $_ => 1 } qw(
            bookmarks fullscreen none thumbnails
        )),
    },

    # Pagesize is specified in points
    'PAGESIZE' => {
        '__DEFAULT__' => 'Letter',
        'Letter' => {
            PAGE_WIDTH  => 8.5 * $PointsPer{I},
            PAGE_HEIGHT => 11 * $PointsPer{I},
        },
        'Legal' => {
            PAGE_WIDTH  => 8.5 * $PointsPer{I},
            PAGE_HEIGHT => 14 * $PointsPer{I},
        },
        'A0' => {
            PAGE_WIDTH  => 2380,
            PAGE_HEIGHT => 3368,
        },
        'A1' => {
            PAGE_WIDTH  => 1684,
            PAGE_HEIGHT => 2380,
        },
        'A2' => {
            PAGE_WIDTH  => 1190,
            PAGE_HEIGHT => 1684,
        },
        'A3' => {
            PAGE_WIDTH  => 842,
            PAGE_HEIGHT => 1190,
        },
        'A4' => {
            PAGE_WIDTH  => 595,
            PAGE_HEIGHT => 842,
        },
    },
);

1;
__END__