Stirling-Tools / Stirling-PDF

#1 Locally hosted web application that allows you to perform various operations on PDF files
https://stirlingpdf.com
MIT License
43.11k stars 3.47k forks source link

[Feature Request] PDF Imposition/Creep Correction #705

Open deltz025 opened 8 months ago

deltz025 commented 8 months ago

Overview

There's currently a lack of polished open source tools that handle the imposition of PDFs. Since Stirling already has some N-up capability, I'm hoping it isn't too big an ask to investigate proper imposition and potentially creep correction.

For reference (if useful), imposition is the process of laying out the pages of a booklet for printing, such that they can be stacked and folded to produce a small book with its pages in proper order. For basic booklet imposition, this means the first sheet of paper will have the front and back covers on one side, and the inner covers on the opposite side. Subsequent sheets show increasing page numbers on the left and decreasing page numbers on the right, until the very middle two pages are next to each other on the final sheet.

An optional (but recommended) part of this process includes creep correction. When printing a booklet, if the goal is to simply fold and staple the stack of paper to produce a book, the centermost pages will stick out past the cover by a certain amount. Creep correction is useful in maintaining consistent layout when trimming those trailing edges, as it will gradually decrease the gutter (inner margin) size between pages closer to the middle of the booklet. This way, elements that are positioned a certain amount of space from the outer edge of the page (such as page numbers) are consistent after the edges are cut.

Other Implementations

Imposition is most comprehensively implemented (with GUI for ease of use) in closed-source desktop publishing software like Adobe's InDesign and is also a key feature in Acrobat's print utility. Dedicated proprietary software for this task includes Kodak Preps and Montax Imposer.

There are, however, a number of open source command-line tools to handle the task, including the Python package pdfimpose and the ruby-based impose. GUI implementations exist via the GTK/Python PDFBooklet and jPDF Tweak (java), a GUI tool to handle this process mathematically.

Considerations

Since Stirling PDF seems to target ease of use and clean UX, I think only implementing basic booklet printing with an optional field for creep correction would be useful. An option to preserve the aspect ratio of the pages may be important (for instance, most users will want to retain the shape of their input document, but users that produced their file with the intention of using an imposition tool will probably have pages sized 8.5"x5.5", with the intended output being a stack of 8.5"x11" sheets).

In general, thanks for putting together this phenomenal PDF multi-tool!

sbplat commented 8 months ago

V2 currently has imposition, but it is still currently in development.