A Python tool for unscrambling PDF documents, particularly useful for handling A3 booklets and rearranging pages.
You can install the package using pip:
pip install unscramblerThis tool requires Ghostscript to be installed on your system for PDF optimization:
- macOS: Install using Homebrew:
brew install ghostscript
- Linux: Install using your package manager:
# Ubuntu/Debian sudo apt-get install ghostscript # Fedora sudo dnf install ghostscript
- Windows: Download and install from Ghostscript's official website
The unscrambler tool can be used from the command line:
unscrambler input.pdf numpages [options]-b, --booklet: Use this option if the original is an A3 booklet. Source PDF is expected to be in landscape with the middle pages coming first.-s, --split: Use this option if you would like the output to be split into multiple files.-r, --rearrange: Use this option to rearrange the pages.-d, --doublePage: Use this option to rearrange pages so that double pages stay together. This assumes there is a front and back cover.-D, --doublePageReversed: Use this option when unscrambling a document for which the -d option was used.-y, --parseYAML: Use when options are being parsed from a YAML file.
- Basic usage:
unscrambler document.pdf 4- Split a booklet:
unscrambler booklet.pdf 4 -b- Rearrange pages:
unscrambler document.pdf 4 -r- Split and rearrange:
unscrambler document.pdf 4 -s -rTo install the package in development mode:
pip install -e .This project is licensed under the MIT License - see the LICENSE file for details.