Rearrange PDF
A Python tool to rearrange PDF pages for printing booklets.
Installation
# Using pip
pip install rearrange-pdf
# Using pipx (recommended for command-line tools)
pipx install rearrange-pdf
# Using uv
uv tool install rearrange-pdf
Usage
Command Line
# Rearrange PDF with 4 slides per page (default)
rearrange-pdf your_document.pdf
# Rearrange PDF with 2 slides per page
rearrange-pdf your_document.pdf --per-page 2
Python API
from rearrange_pdf import rearrange_pages
# Rearrange with 4 slides per page
new_pdf = rearrange_pages("your_document.pdf", per_page=4)
# Rearrange with 2 slides per page
new_pdf = rearrange_pages("your_document.pdf", per_page=2)
How it works
This tool rearranges PDF pages to create a booklet layout:
- For 4 slides per page: Pages are rearranged in the order [0, 2, 4, 6, 3, 1, 7, 5]
- For 2 slides per page: Pages are rearranged in the order [0, 2, 1, 3]
If the total number of pages is not divisible by the group size (8 for 4-per-page, 4 for 2-per-page), blank pages are added to complete the group.
Printing Instructions
When printing the rearranged PDF:
- Select "Print on both sides" or "Double-sided printing" in your print dialog
- Select the "Multiple pages per sheet" option in your print dialog
- Choose either 2 or 4 pages per sheet depending on your preference
- For 4 pages per sheet: Select "Flip on short edge" for proper booklet orientation
- For 2 pages per sheet: Select "Flip on long edge" for proper booklet orientation
This will ensure your booklet prints correctly and can be folded properly.
License
MIT
Metadata
Release files for rearrange-pdf 0.1.2
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 | Actions |
|---|---|---|---|---|
| rearrange_pdf-0.1.2.tar.gz | 4.1 kB | Without provenance | Details for rearrange_pdf-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rearrange_pdf-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for rearrange_pdf-0.1.2-py3-none-any.whl |
Total release size: 8.9 kB
Release files / rearrange_pdf-0.1.2.tar.gz
| Download URL | rearrange_pdf-0.1.2.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd06c010fd9ddc991fd36439b0a7ee607e1be789586b4af8536630690af7f770
|
|
BLAKE2b-256 checksum How to use checksums |
35f48ae7cd63cea611c1078daf9274687d7912ded34972738f4e58240a9dfdc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Release files / rearrange_pdf-0.1.2-py3-none-any.whl
| Download URL | rearrange_pdf-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b0a54fb7f9b32c0920fc407ae40a632737c8b8e8058d147487fe02110df2041
|
|
BLAKE2b-256 checksum How to use checksums |
9b55858545c3b542646df61b377c0396efa84e863c65b7735d36ea2ea4dcb43f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.6
|
Security for rearrange-pdf 0.1.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.