PDF::Imposition - Perl module to manage the PDF imposition
Version 0.26
This module is meant to simplify the so-called imposition, i.e., rearrange the pages of a PDF to get it ready to be printed and folded, with more logical pages placed on the sheet, usually (but not exclusively) on recto and verso.
This is what the routine looks like:
use PDF::Imposition; my $imposer = PDF::Imposition->new(file => "test.pdf", outfile => "out.pdf", # or # suffix => "-imposed", signature => "40-80", cover => 0, schema => "2up"); $imposer->impose; print "Output left in " . $imposer->outfile;
Please note that you don't pass the PDF dimensions (which are extracted from the source PDF itself by the class, using the very first page: if you want imposition, I do the reasonable assumption you have all the pages with the same dimensions).
The input file
The output file
The suffix of the output file (don't mix the two options).
The schema to use.
See PDF::Imposition::Schema2up
See PDF::Imposition::Schemaduplex2up
See PDF::Imposition::Schema2down
See PDF::Imposition::Schema2x4x1
See PDF::Imposition::Schema2x4x2
See PDF::Imposition::Schema2side
See PDF::Imposition::Schema4up
See PDF::Imposition::Schema1x4x2cutfoldbind
See PDF::Imposition::Schema1repeat2top
See PDF::Imposition::Schema1repeat2side
See PDF::Imposition::Schema1repeat4
See PDF::Imposition::Schemaea4x4
See PDF::Imposition::Schema1x8x2
See PDF::Imposition::Schema1x1
If the last logical page must be placed at the very end, after the blank pages used to pad the signature. (2up, 2down 1x4x2cutfoldbind, 4up, 1x1 only).
2up
2down
1x4x2cutfoldbind
4up
1x1
Often it happens that we want the last page of the pdf to be the last one on the physical booklet after folding. If cover is set to a true value, the last page of the logical pdf will be placed on the last page of the last signature.
cover
The signature (integer multiple of four or range): 2up and 2down only.
Passing this option triggers the cropmarks. While the original dimensions are left unchanged, this size represents the size of the logical page which is actually imposed.
For example, you have a PDF in a6, you pass a5 as paper, and schema 2up, you are going to get an a4 with 2 a6 with cropmarks.
a5
This option is passed to PDF::Cropmarks. See the module documentation for the accepted values.
The title to set in the PDF meta information. Defaults to the basename.
The following options are passed verbatim to PDF::Cropmarks. See the module documentation for the meaning and accepted values.
Defaults to 0.1mm
0.1mm
Defaults to 8pt
8pt
Defaults to 1mm
1mm
Defaults to 12mm
12mm
Main method which does the actual job. You have to call this to get your file. It returns the output filename.
Return the version string.
Called on the class (not on the object returned by new) will report the list of available schema.
new
E.g.
PDF::Imposition->available_schemas;
Constant picked from AMW_DEBUG environment.
Marco Pessotto, <melmothx at gmail.com>
<melmothx at gmail.com>
Please report any bugs or feature requests to the author's email. If you find a bug, please provide a minimal example file which reproduces the problem (so I can add it to the test suite).
Or, at your discretion, feel free to use the CPAN's RT.
You can find documentation for this module with the perldoc command.
perldoc PDF::Imposition
https://github.com/melmothx/pdf-imposition-perl
http://knackered.org/angus/psutils/ (shipped by any decent GNU/Linux distro and in TeXlive!). If you don't bother the PDF->PS->PDF route, it's a great and useful tool which just aged well.
http://www.ctan.org/pkg/pdfpages
http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/firth/software/pdfjam/ (buil on the top of pdfpages)
http://wiki.contextgarden.net/Imposition
The names of schemas are taken straight from the ConTeXt ones (if existing), as described in the book Layouts in context, by Willi Egger, Hans Hagen and Taco Hoekwater, 2011.
The idea is to provide a wide range of imposition schemas (at least the same provided by ConTeXt). This could require some time. If you want to contribute, feel free to fork the repository and send a pull request or a patch (please include documentation and at some tests).
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
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.