momijizukamori / bookbinder-js

A JS application to format PDFs for bookbinding.
Mozilla Public License 2.0
99 stars 26 forks source link

Support for signatures with 4mod8 pages in quarto etc #22

Open Lottie16 opened 1 year ago

Lottie16 commented 1 year ago

Functionality for eg 20-page signatures imposed quarto.

Vague ramblings on how it could function:

In terms of pseudo-code functioning (as I do not know js, I think this is the order in which it does things but I'm not 100% sure I've got it right) (n is number of pages per sheet, p is pages per signature = 0mod4)

this should give x/4 blank pieces of paper on the outside of the signature once folded and cut in terms of error margins when dividing, currently 4/60 (0.0666) is the minimum step, so an accidental full-sheet signature number should be fine if error is 1e-2 or lower. Alternatively there should be a way of calculating x without dividing (Python equiv below)

y=n    # (or 0)
while y<p:
   y=+n 

x=y-p