#!/usr/bin/env perl

use v5.6;
use strict;
# use warnings;

require  App::paperback;
exit App::paperback->main(@ARGV);

__END__

=encoding utf-8

=head1 NAME

paperback - imposition of PDF pages for signature printing and bounding

=head1 SYNOPSIS

B<paperback> B<file.pdf> (produces file-paperback.pdf)

B<paperback> [ option ]

Options:

    -v      print version and exit (also --version)
    -h      print summary help and exit (also --help)


=head1 VERSION

Version 0.33

=head1 DESCRIPTION

This program takes a PDF whose pages are small in size (A6, A5, Quarter Letter,
Half Letter, Quarter Legal and Half Legal are supported) and produces a new PDF
file, A4 or Letter or Legal in page size, with the original pages arranged in
the correct order to be printed, folded, cut, and sewn together in signatures.
This transformation is called “imposition”.

All pages in the input PDF file will be imposed on a new PDF with
bigger paper size, ready to be duplex-printed, folded and put together
into signatures, according to its original page size. Input PDF is 
always assumed to be composed of vertical pages of the same size.

ISO 216 normalised (international) page sizes:

=over 4

Input page sizes A6 (105 × 148 mm) and A5 (148 × 210 mm) produce
an output page size of A4 (210 × 297 mm). Four A6 pages will be put
on each A4 page, or two A5 pages will be put on each A4 page. 
Before that, input pages will be reordered and reoriented so as to
produce a final PDF fit for duplex 'long-edge-flip' printing.

=back

ANSI normalised (US) page sizes:

=over 4

Input page sizes Quarter Letter (4.25 × 5.5 in) and Half Letter (5.5
× 8,5 in) produce a Letter output page size (8.5 × 11 in). Input
page sizes Quarter Legal (4.25 × 7 in) and Half Legal (7 × 8,5 in)
produce a Legal output page size (8.5 × 14 in). Four Quarter-Letter
pages will be put on each Letter page, two Half-Letter pages will be
put on each Letter page, four Quarter-Legal pages will be put on each
Legal page, or two Half-Legal pages will be put on each Legal page.
Before that, input pages will be reordered and reoriented so as to 
produce a final PDF fit for duplex 'long-edge-flip' printing.

=back

=head1 LIMITATIONS

Input page sizes allowed are A5, A6, Half Letter, Quarter Letter,
Half Legal and Quarter Legal. Other sizes give an error message.

Only PDF v1.4 is supported as input, although many higher-labeled
PDF files are correctly handled since they are essentially v1.4 PDF
files stamped as something more modern.

=head1 INSTALL

$ cpanm App::paperback

=head1 AUTHOR

Héctor M. Monacci

=head1 LICENSE

Copyright 2022 - Héctor M. Monacci.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 SEE ALSO

L<App::paperback>

L<https://github.com/hectormonacci/perl-app-paperback>

L<https://en.wikipedia.org/wiki/Imposition>

=cut

