The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

paperback - imposition of PDF pages for signature printing and binding

SYNOPSIS

paperback file.pdf (produces file-paperback.pdf)

paperback [ option ]

Options:

    -v print version and exit (also --version)

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

VERSION

Version 1.04

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:

    Input page sizes A6 (105 x 148 mm) and A5 (148 x 210 mm) produce an output page size of A4 (210 x 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.

ANSI normalised (US) page sizes:

    Input page sizes Quarter Letter (4.25 x 5.5 in) and Half Letter (5.5 x 8,5 in) produce a Letter output page size (8.5 x 11 in). Input page sizes Quarter Legal (4.25 x 7 in) and Half Legal (7 x 8,5 in) produce a Legal output page size (8.5 x 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.

SCHEMA EXPLANATION

1. Which schema series (4up or 2up) is used depends on input PDF page size. For page sizes A6 (105 x 148 mm), Quarter Letter (4.25 x 5.5 in) and Quarter Legal (4.25 x 7 in), a 4up schema is used. For page sizes A5 (148 x 210 mm), Half Letter (5.5 x 8.5 in) and Half Legal (7 x 8.5 in in), a 2up schema is used.

2. What page size is used for the output PDF depends on input size page. For input size pages A6 or A5, the output PDF pages are A4 (210 x 297 mm); for input size pages Quarter Letter or Half Letter, the output PDF pages are Letter (8.5 x 11 in); for input size pages Quarter Legal or Half Legal, the output PDF pages are Legal (8.5 x 14 in).

3. How many signatures are produced depends on the amount of input pages to be processed. Recto-verso (or duplex) printing is always assumed. Maximum number of pages in a signature is 16 for all schemas, but a signature is composed of fewer pages when the input PDF is below 16 pages.

Rearranging of pages is made according the following rules.

4UP SCHEMA FOR 13 INPUT PAGES OR MORE

       RECTO              VERSO
  +------+------+    +------+------+
  |      |      |    |      |      |
  |  16  |   1  |    |   2  |  15  |
  |      |      |    |      |      |
  +------+------+    +------+------+ <- cut here
  |      |      |    |      |      |
  |  13  |   4  |    |   3  |  14  | <- row upside down
  |      |      |    |      |      |
  +------+------+    +------+------+

  +------+------+    +------+------+
  |      |      |    |      |      |
  |  12  |   5  |    |   6  |  11  |
  |      |      |    |      |      |
  +------+------+    +------+------+ <- cut here
  |      |      |    |      |      |
  |   9  |   8  |    |   7  |  10  | <- row upside down
  |      |      |    |      |      |
  +------+------+    +------+------+

To complete the block of 16 logical pages, blank pages are inserted if needed. Beyond page 16, a new signature is started, with pages imposed this same way (these page numbers + 16, these page numbers + 32, etc).

4UP SCHEMA FOR 9 TO 12 INPUT PAGES

       RECTO              VERSO
  +------+------+    +------+------+
  |      |      |    |      |      |
  |  12  |   1  |    |   2  |  11  |
  |      |      |    |      |      |
  +------+------+    +------+------+ <- cut here
  |      |      |    |      |      |
  |   9  |   4  |    |   3  |  10  | <- row upside down
  |      |      |    |      |      |
  +------+------+    +------+------+

  +------+------+    +------+------+
  |      |      |    |      |      |
  |   6  |   7  |    |   8  |   5  |
  |      |      |    |      |      |
  +------+------+    +------+------+ <- cut here
  |      |      |    |      |      |
  |  --  |  --  |    |  --  |  --  | <- row entirely blank
  |      |      |    |      |      |
  +------+------+    +------+------+

4UP SCHEMA FOR 5 TO 8 INPUT PAGES

       RECTO              VERSO
  +------+------+    +------+------+
  |      |      |    |      |      |
  |   8  |   1  |    |   2  |   7  |
  |      |      |    |      |      |
  +------+------+    +------+------+ <- cut here
  |      |      |    |      |      |
  |   5  |   4  |    |   3  |   6  | <- row upside down
  |      |      |    |      |      |
  +------+------+    +------+------+

4UP SCHEMA FOR 1 TO 4 INPUT PAGES

       RECTO              VERSO
  +------+------+    +------+------+
  |      |      |    |      |      |
  |   4  |   1  |    |   2  |   3  |
  |      |      |    |      |      |
  +------+------+    +------+------+ <- cut here
  |      |      |    |      |      |
  |  --  |  --  |    |  --  |  --  | <- row entirely blank
  |      |      |    |      |      |
  +------+------+    +------+------+

2UP SCHEMA FOR 13 INPUT PAGES OR MORE

       RECTO              VERSO
  +-------------+    +-------------+
  |             |    |             |
  |      1      |    |      2      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |     16      |    |     15      |
  |             |    |             |
  +-------------+    +-------------+

  +-------------+    +-------------+
  |             |    |             |
  |      3      |    |      4      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |     14      |    |     13      |
  |             |    |             |
  +-------------+    +-------------+

  +-------------+    +-------------+
  |             |    |             |
  |      5      |    |      6      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |     12      |    |     11      |
  |             |    |             |
  +-------------+    +-------------+

  +-------------+    +-------------+
  |             |    |             |
  |      7      |    |      8      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |     10      |    |      9      |
  |             |    |             |
  +-------------+    +-------------+

To complete the block of 16 logical pages, blank pages are inserted if needed. Beyond page 16, a new signature is started, with pages imposed this same way (these page numbers + 16, these page numbers + 32, etc).

2UP SCHEMA FOR 9 TO 12 INPUT PAGES

       RECTO              VERSO
  +-------------+    +-------------+
  |             |    |             |
  |      1      |    |      2      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |     12      |    |     11      |
  |             |    |             |
  +-------------+    +-------------+

  +-------------+    +-------------+
  |             |    |             |
  |      3      |    |      4      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |     10      |    |      9      |
  |             |    |             |
  +-------------+    +-------------+

  +-------------+    +-------------+
  |             |    |             |
  |      5      |    |      6      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |      8      |    |      7      |
  |             |    |             |
  +-------------+    +-------------+

2UP SCHEMA FOR 5 TO 8 INPUT PAGES

       RECTO              VERSO
  +-------------+    +-------------+
  |             |    |             |
  |      1      |    |      2      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |      8      |    |      7      |
  |             |    |             |
  +-------------+    +-------------+

  +-------------+    +-------------+
  |             |    |             |
  |      3      |    |      4      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |      6      |    |      5      |
  |             |    |             |
  +-------------+    +-------------+

2UP SCHEMA FOR 1 TO 4 INPUT PAGES

       RECTO              VERSO
  +-------------+    +-------------+
  |             |    |             |
  |      1      |    |      2      |
  |             |    |             |
  +-------------+    +-------------+ <- fold here
  |             |    |             |
  |      4      |    |      3      |
  |             |    |             |
  +-------------+    +-------------+

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.

INSTALL

$ cpanm App::paperback (or sudo cpanm App::paperback)

UNINSTALL

$ cpanm --uninstall App::paperback (or sudo cpanm --uninstall App::paperback)

AUTHOR

Hector M. Monacci

LICENSE

Copyright 2022 - Hector M. Monacci.

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

SEE ALSO

App::paperback

https://github.com/hectormonacci/perl-app-paperback

https://en.wikipedia.org/wiki/Imposition