-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
119 lines (83 loc) · 3.89 KB
/
README
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
NAME
PDF::Create - create PDF files
DESCRIPTION
PDF::Create allows you to create PDF documents using a large
number of primitives, and emit the result as a PDF file or
stream. PDF stands for Portable Document Format.
Documents can have several pages, a table of content, an
information section and many other PDF elements. More
functionnalities will be added as needs arise.
Documents are constructed on the fly so the memory footprint is
not tied to the size of the pages but only to their number.
It's main advantage over the other PDF modules is that it does
not depend on other modules and is perl only (no compiler needed).
If you want a quick and dirty way of creating pdf's, PDF::Create
is for you. If you need a complete Framework to create complex
PDF stuff, you better dive into the PDF::API2 based modules.
More information about this module is included in this package.
SYNOPSIS
use PDF::Create;
my $pdf = new PDF::Create('filename' => 'mypdf.pdf',
'Version' => 1.2,
'PageMode' => 'UseOutlines',
'Author' => 'Fabien Tassin',
'Title' => 'My title',
);
my $root = $pdf->new_page('MediaBox' => [ 0, 0, 612, 792 ]);
# Add a page which inherits its attributes from $root
my $page = $root->new_page;
# Prepare 2 fonts
my $f1 = $pdf->font('Subtype' => 'Type1',
'Encoding' => 'WinAnsiEncoding',
'BaseFont' => 'Helvetica');
my $f2 = $pdf->font('Subtype' => 'Type1',
'Encoding' => 'WinAnsiEncoding',
'BaseFont' => 'Helvetica-Bold');
# Prepare a Table of Content
my $toc = $pdf->new_outline('Title' => 'Document',
'Destination' => $page);
$toc->new_outline('Title' => 'Section 1');
my $s2 = $toc->new_outline('Title' => 'Section 2');
$s2->new_outline('Title' => 'Subsection 1');
$page->stringc($f2, 40, 306, 426, "PDF::Create");
$page->stringc($f1, 20, 306, 396, "version $PDF::Create::VERSION");
# Add another page
my $page2 = $root->new_page;
$page2->line(0, 0, 612, 792);
$page2->line(0, 792, 612, 0);
$toc->new_outline('Title' => 'Section 3');
$pdf->new_outline('Title' => 'Summary');
# Add something to the first page
$page->stringc($f1, 20, 306, 300,
'by Fabien Tassin <[email protected]>');
# Add the missing PDF objects and a the footer then close the file
$pdf->close;
INSTALLATION
Quick answer:
perl -MCPAN -e 'install PDF::Create'
Long answer:
To install manually, cd to the directory containing the unpacked
distribution and do one of the following:
a. Create a makefile by running Makefile.PL using the perl
program into whose library you want to install and then run
make three times:
perl Makefile.PL
make
make test
make install
b. To install into a private library, for example your home
directory:
perl Makefile.PL INSTALLSITELIB=$HOME/lib INSTALLMAN3DIR=$HOME/man
make
make test
make pure_install
AUTHORS
- Fabien Tassin
Original Author of PDF::Create
- Markus Baertschi, [email protected]
I have taken over maintenence of PDF::Create as Fabien has disappeared
and did no longer maintain it in the last years.
The last version of PDF::Create from Fabien is 0.06. All never versions
have been modified by me.
I maintain PDF::Create in git. You can access the repository directly
at http://github.com/markusb/pdf-create.