PDF::Imposition::Schema - Role for the imposition schemas.
This class provides the shared method for real imposition schemas and can't me called directly.
Consuming classes must provide a _do_impose method.
_do_impose
use PDF::Imposition; my $imposer = PDF::Imposition->new(file => "test.pdf", # either use outfile => "out.pdf", # or suffix suffix => "-2up" ); $imposer->impose; or use PDF::Imposition; my $imposer = PDF::Imposition->new(); $imposer->file("test.pdf"); $imposer->outfile("out.pdf"); # or $imposer->suffix("-imp"); $imposer->impose;
All the following accessors accept an argument, which sets the value.
Unsurprisingly, the input file, which must exist.
The destination file of the imposition. You may prefer to use the suffix method below, which takes care of the filename.
The suffix of the file. By default, '-imp', so test.pdf imposed will be saved as 'test-imp.pdf'. If test-imp.pdf already exists, it will be replaced merciless.
The signature, must be a multiple of the pages_per_sheet option (usually 4 or 8), or a range, like the string "20-100". If a range is selected, the signature is determined heuristically to minimize the white pages left on the last signature. The wider the range, the better the results.
pages_per_sheet
The number of logical pages which fit on a sheet, recto-verso. Default to 1. Subclasses usually change this and ignore your option unless otherwise specified.
The title to set in the PDF meta information. Defaults to the basename.
The following methods are used internally but documented for schema's authors.
Returns an hashref with the original pdf dimensions in points.
{ w => 800, h => 600 }
Returns the number of pages
Internal usage. It's the PDF::API2 object used as source.
Internal usage. The PDF::API2 object used as output.
Retrieve the page form object from the input pdf to the output pdf, and return it. The method return undef if the page is out of range.
Do the job and leave the output in $self->outfile, cleaning up the internal objects.
$self->outfile
If outfile is not provided, use the suffix provided and return the filename.
Return the actual number of signature, resolving 0 to the nearer signature.
Return the computed number of pages of the output, taking in account the signature handling.
Object cleanup.
By default, cropmarks are centered and twoside is true.
PDF::Imposition
To install PDF::Imposition, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PDF::Imposition
CPAN shell
perl -MCPAN -e shell install PDF::Imposition
For more information on module installation, please visit the detailed CPAN module installation guide.