+spine_limit = 1 * points_per_cm
+desc = """bookmaker.py is a helper for optimizing PDFs of books for the production of small self-printed, self-bound physical books To this goal it offers various PDF manipulation options potentially that can also be used indepéndently and for other purposes.
+"""
+epilogue = """
+EXAMPLES:
+
+Concatenate two PDFs A.pdf and B.pdf to COMBINED.pdf:
+ bookmaker.py --input_file A.pdf --input_file B.pdf --output_file COMBINED.pdf
+
+Produce OUTPUT.pdf containing all pages of (inclusive) page number range 3-7 from INPUT.pdf:
+ bookmaker.py -i INPUT.pdf --page_range 3-7 -o OUTPUT.pdf
+
+Produce COMBINED-pdf from A.pdf's first 7 pages, B.pdf's pages except its first two, and all pages of C.pdf:
+ bookmaker.py -i A.pdf -p start-7 -i B.pdf -p 3-end -i C.pdf -o COMBINED.pdf
+
+Crop each page 5cm from the left, 10cm from the bottom, 2cm from the right, and 0cm from the top:
+ bookmaker.py -i INPUT.pdf -o OUTPUT.pdf --crops "5,10,2,0"
+
+Include all pages from INPUT.pdf, but crop pages 10-20 by 5cm each from bottom and top:
+ bookmaker.py -i INPUT.pdf -c "10-20:0,5,0,5" -o OUTPUT.pdf
+
+Same crops from on pages 10-20, but also crop all pages 30 and later by 3cm each from left and right:
+ bookmaker.py -i INPUT.pdf -o OUTPUT.pdf -c "10-20:0,5,0,5" -c "30-end:3,0,3,0"
+
+Rotate by 90° pages 3, 5, 7; rotate page 7 once more by 90% (i.e. 180° in total):
+ bookmaker.py -i INPUT.pdf -o OUTPUT.pdf --rotate 3 -r 5 -r 7 -r 7
+
+Initially declare 5cm crop from the left and 1cm crop from right, but alternate direction between even and odd pages:
+ bookmaker.py -i INPUT.pdf -o OUTPUT.pdf -c "5,0,1,0" -s
+
+Quarter each OUTPUT.pdf page to carry 4 pages from INPUT.pdf, draw stencils into inner margins for cuts to carry binding strings:
+ bookmaker.py -i INPUT.pdf -o OUTPUT.pdf --nup4
+
+Same as --nup4, but define a printable-region margin of 1.3cm to limit the space for the INPUT.pdf pages in OUTPUT.pdf page quarters:
+ bookmaker.py -i INPUT.pdf -o OUTPUT.pdf -n --print_margin 1.3
+
+Same as -n, but draw lines marking printable-region margins, page quarts, spine margins:
+ bookmaker.py -i INPUT.pdf -o OUTPUT.pdf -n --analyze
+
+NOTES:
+
+For arguments like -p, page numbers are assumed to start with 1 (not 0, which is treated as an invalid page number value).
+
+The target page shape so far is assumed to be A4 in portrait orientation; bookmaker.py normalizes all pages to this format before applying crops, and removes any source PDF /Rotate commands (for their production of landscape orientations).
+
+The --nup4 quartering puts pages into a specific order optimized for no-tumble duplex print-outs that can easily be folded and cut into pages of a small A6 book. Each unit of 8 pages from the source PDF is mapped thus onto two subsequent pages (i.e. front and back of a printed A4 paper):
+
+ (front) (back)
++-------+ +-------+
+| 4 | 1 | | 3 | 2 |
+|-------| |-------|
+| 8 | 5 | | 7 | 6 |
++-------+ +-------+
+
+To facilitate this layout, --nup4 also pads the input PDF pages to a total number that is a multiple of 8, by adding empty pages.