No project description provided
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file convert_two_up_imposed_pdf-1.0.0.tar.gz.
File metadata
- Download URL: convert_two_up_imposed_pdf-1.0.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cc112a48cee04f35fba9f4c53b498e0a692b760d3668e3ce7a3975a72a04f9e
|
|
| MD5 |
f5ea4d02e222d72131ccad1810fbe139
|
|
| BLAKE2b-256 |
6ab16a0997bf7f1ab3c3027bb83d8fac9f48210b0f1b7a085eddc409c5495bf9
|
Provenance
The following attestation bundles were made for convert_two_up_imposed_pdf-1.0.0.tar.gz:
Publisher:
publish-to-pypi.yml on gene1wood/convert-two-up-imposed-pdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convert_two_up_imposed_pdf-1.0.0.tar.gz -
Subject digest:
3cc112a48cee04f35fba9f4c53b498e0a692b760d3668e3ce7a3975a72a04f9e - Sigstore transparency entry: 737342036
- Sigstore integration time:
-
Permalink:
gene1wood/convert-two-up-imposed-pdf@1cd16d06e292045eaf370dc7ec7c24ffb67eb2ea -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/gene1wood
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1cd16d06e292045eaf370dc7ec7c24ffb67eb2ea -
Trigger Event:
push
-
Statement type:
File details
Details for the file convert_two_up_imposed_pdf-1.0.0-py3-none-any.whl.
File metadata
- Download URL: convert_two_up_imposed_pdf-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
146f922fd8058412b0c0af6ee706d047f00f9cae4f4bd5467038c8af68d6c7c4
|
|
| MD5 |
a2f8aa3a21d4b993ff0ad2b50f894237
|
|
| BLAKE2b-256 |
d1fc71157c6c04184170b3503c8cbf29055abdedd81ed9bd7d3b390e3949265d
|
Provenance
The following attestation bundles were made for convert_two_up_imposed_pdf-1.0.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on gene1wood/convert-two-up-imposed-pdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
convert_two_up_imposed_pdf-1.0.0-py3-none-any.whl -
Subject digest:
146f922fd8058412b0c0af6ee706d047f00f9cae4f4bd5467038c8af68d6c7c4 - Sigstore transparency entry: 737342042
- Sigstore integration time:
-
Permalink:
gene1wood/convert-two-up-imposed-pdf@1cd16d06e292045eaf370dc7ec7c24ffb67eb2ea -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/gene1wood
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1cd16d06e292045eaf370dc7ec7c24ffb67eb2ea -
Trigger Event:
push
-
Statement type: