1 | #
|
---|
2 | # PDF.pm, version 1.11 February 2000 antro
|
---|
3 | #
|
---|
4 | # Copyright (c) 1998 - 2000 Antonio Rosella Italy [email protected], Johannes Blach [email protected]
|
---|
5 | #
|
---|
6 | # Free usage under the same Perl Licence condition.
|
---|
7 | #
|
---|
8 |
|
---|
9 | package PDF;
|
---|
10 |
|
---|
11 | $PDF::VERSION = "1.11";
|
---|
12 |
|
---|
13 | require 5.005;
|
---|
14 |
|
---|
15 | #require PDF::Core;
|
---|
16 | #require PDF::Parse;
|
---|
17 | require Core;
|
---|
18 | require Parse;
|
---|
19 |
|
---|
20 | use strict;
|
---|
21 | use Carp;
|
---|
22 | use Exporter ();
|
---|
23 |
|
---|
24 | use vars qw(@ISA $Verbose);
|
---|
25 |
|
---|
26 | #
|
---|
27 | # Verbose off by default
|
---|
28 | #
|
---|
29 | $Verbose = 0;
|
---|
30 |
|
---|
31 | @ISA = qw(Exporter PDF::Core PDF::Parse);
|
---|
32 |
|
---|
33 | 1;
|
---|
34 |
|
---|
35 | __END__
|
---|
36 |
|
---|
37 | =head1 NAME
|
---|
38 |
|
---|
39 | PDF - Library for PDF access and manipulation in Perl
|
---|
40 |
|
---|
41 | =head1 SYNOPSIS
|
---|
42 |
|
---|
43 | use PDF;
|
---|
44 |
|
---|
45 | $pdf=PDF->new ;
|
---|
46 | $pdf=PDF->new(filename);
|
---|
47 |
|
---|
48 | $result=$pdf->TargetFile( filename );
|
---|
49 |
|
---|
50 | print "is a pdf file\n" if ( $pdf->IsaPDF ) ;
|
---|
51 | print "Has ",$pdf->Pages," Pages \n";
|
---|
52 | print "Use a PDF Version ",$pdf->Version ," \n";
|
---|
53 | print "and it is crypted " if ( $pdf->IscryptedPDF) ;
|
---|
54 |
|
---|
55 | print "filename with title",$pdf->GetInfo("Title"),"\n";
|
---|
56 | print "and with subject ",$pdf->GetInfo("Subject"),"\n";
|
---|
57 | print "was written by ",$pdf->GetInfo("Author"),"\n";
|
---|
58 | print "in date ",$pdf->GetInfo("CreationDate"),"\n";
|
---|
59 | print "using ",$pdf->GetInfo("Creator"),"\n";
|
---|
60 | print "and converted with ",$pdf->GetInfo("Producer"),"\n";
|
---|
61 | print "The last modification occurred ",$pdf->GetInfo("ModDate"),"\n";
|
---|
62 | print "The associated keywords are ",$pdf->GetInfo("Keywords"),"\n";
|
---|
63 |
|
---|
64 | my (startx,starty, endx,endy) = $pdf->PageSize ($page) ;
|
---|
65 |
|
---|
66 | =head1 DESCRIPTION
|
---|
67 |
|
---|
68 | The main purpose of the PDF library is to provide classes and
|
---|
69 | functions that allow to read and manipulate PDF files with perl. PDF
|
---|
70 | stands for Portable Document Format and is a format proposed by Adobe.
|
---|
71 | A full description of this format can be found in the B<Portable
|
---|
72 | Document Reference Manual> by B<Adobe Systems Inc.>. For more details
|
---|
73 | about PDF, refer to:
|
---|
74 |
|
---|
75 | B<http://www.adobe.com/>
|
---|
76 |
|
---|
77 | The main idea is to provide some "basic" modules for access
|
---|
78 | the information contained in a PDF file. Even if at this
|
---|
79 | moment is in an early development stage, the scripts in the
|
---|
80 | example directory show that it is usable.
|
---|
81 |
|
---|
82 | B<is_pdf> script test a list of files in order divide the PDF file
|
---|
83 | from the non PDF using the info provided by the files
|
---|
84 | themselves. It doesn't use the I<.pdf> extension, it uses the information
|
---|
85 | contained in the file.
|
---|
86 |
|
---|
87 | B<pdf_version> returns the PDF level used for writing a file.
|
---|
88 |
|
---|
89 | B<pdf_pages> gives the number of pages of a PDF file.
|
---|
90 |
|
---|
91 | B<pagedump.pl> prints some information about individual pages in a
|
---|
92 | PDF-file. Although the information as such are not very useful, it
|
---|
93 | demontrates well some more complex aspects of the library. Check the
|
---|
94 | function B<doprint> in this program on how to handle all possible data
|
---|
95 | occuring in a PDF.
|
---|
96 |
|
---|
97 | The library is now splitted in 2 section :
|
---|
98 |
|
---|
99 | B<PDF::Core> that contains the data structure, the constructor and low
|
---|
100 | level access fuctions;
|
---|
101 |
|
---|
102 | B<PDF::Parse> all kind of functions to parse the PDF-files and
|
---|
103 | provide information about the content.
|
---|
104 |
|
---|
105 | Check the help-files of these modules for more details.
|
---|
106 |
|
---|
107 | =head1 Variables
|
---|
108 |
|
---|
109 | There are 2 variables that can be accessed:
|
---|
110 |
|
---|
111 | =over 4
|
---|
112 |
|
---|
113 | `=item B<$PDF::VERSION>
|
---|
114 |
|
---|
115 | Contain the version of the library installed.
|
---|
116 |
|
---|
117 | =item B<$PDF::Verbose>
|
---|
118 |
|
---|
119 | This variable is false by default. Change the value if you want
|
---|
120 | more verbose output messages from library.
|
---|
121 |
|
---|
122 | =back 4
|
---|
123 |
|
---|
124 | =head1 Copyright
|
---|
125 |
|
---|
126 | Copyright (c) 1998 - 2000 Antonio Rosella Italy [email protected], Johannes Blach [email protected]
|
---|
127 |
|
---|
128 | This library is free software; you can redistribute it and/or
|
---|
129 | modify it under the same terms as Perl itself.
|
---|
130 |
|
---|
131 | =head1 Availability
|
---|
132 |
|
---|
133 | The latest version of this library is likely to be available from:
|
---|
134 |
|
---|
135 | http://www.geocities.com/CapeCanaveral/Hangar/4794/
|
---|
136 |
|
---|
137 | and at any CPAN mirror
|
---|
138 |
|
---|
139 | =head1 Greetings
|
---|
140 |
|
---|
141 | Fabrizio Pivari ( [email protected] ) for all the suggestions about life, the universe and everything.
|
---|
142 | Brad Appleton ( [email protected] ) for his suggestions about the module organization.
|
---|
143 | Thomas Drillich for the iso latin1 support
|
---|
144 | Ross Moore ( [email protected] ) for ReadInfo fix
|
---|
145 |
|
---|
146 | =cut
|
---|
147 |
|
---|
148 |
|
---|
149 |
|
---|
150 |
|
---|
151 |
|
---|
152 |
|
---|
153 |
|
---|