Convert Two Up Imposed PDF
A Python tool to process scanned 2-up imposed PDFs (signature scans) and produce upright, single-page PDFs in correct reading order.
This tool handles:
- Alternating 90° rotated scans (top of page on right/left alternates)
- 2-up page splitting (left/right halves of each scanned sheet)
- Signature reordering to restore natural reading order
- Optional compression and quality control for high-DPI scans
Features
- Fully automated for signature PDFs (number of pages must be a multiple of 4)
- Outputs a standard, upright PDF ready for printing or digital use
- Adjustable JPEG compression for smaller file sizes
- Cross-platform (requires Python 3.8+)
Installation
pip install convert-two-up-imposed-pdf
Usage
convert-two-up-imposed-pdf <input_pdf> <output_pdf> [--dpi DPI]
Arguments
| Argument | Description |
|---|---|
input_pdf |
Path to the scanned 2-up PDF file |
output_pdf |
Path to save the final upright, single-page PDF |
--dpi |
(Optional) Render DPI for rasterization. Default: 150. Higher DPI → better quality, larger files |
Example
convert-two-up-imposed-pdf scanned_booklet.pdf output_booklet.pdf --dpi 200
- Detects the number of scanned sheets
- Computes total logical pages
- Applies alternating rotation correction
- Splits 2-up pages
- Reorders pages according to booklet imposition
- Saves the final upright PDF
Compression and Quality Tips
- By default, pages are saved as JPEG to reduce file size
- Adjust
--dpifor higher or lower resolution - You can tweak the JPEG quality in the code (default: 85) to balance file size and image fidelity
- Optional grayscale conversion and subsampling further reduce file size for text-heavy scans
Requirements
Limitations
- Total logical pages must be a multiple of 4
- Assumes strictly alternating rotation for scanned pages (top of page right/left)
- Works best for scanned image-based PDFs; vector PDFs may not behave as expected
License
Acknowledgements
Most code in this repository, including this README, was produced by the ChatGPT (OpenAI) LLM. Some tweaks and improvements were made by the human author. The human author reviewed and verified all output.
Metadata
Release files for convert-two-up-imposed-pdf 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| convert_two_up_imposed_pdf-1.0.0.tar.gz | 5.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| convert_two_up_imposed_pdf-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / convert_two_up_imposed_pdf-1.0.0.tar.gz
| Download URL | convert_two_up_imposed_pdf-1.0.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cc112a48cee04f35fba9f4c53b498e0a692b760d3668e3ce7a3975a72a04f9e
|
|
BLAKE2b-256 checksum How to use checksums |
6ab16a0997bf7f1ab3c3027bb83d8fac9f48210b0f1b7a085eddc409c5495bf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2025.
Transparency logRelease files / convert_two_up_imposed_pdf-1.0.0-py3-none-any.whl
| Download URL | convert_two_up_imposed_pdf-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
146f922fd8058412b0c0af6ee706d047f00f9cae4f4bd5467038c8af68d6c7c4
|
|
BLAKE2b-256 checksum How to use checksums |
d1fc71157c6c04184170b3503c8cbf29055abdedd81ed9bd7d3b390e3949265d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2025.
Transparency logSecurity for convert-two-up-imposed-pdf 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for convert_two_up_imposed_pdf-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.