pdfmerge
Command-line utility for merging, splicing, and rotating PDF documents.
Changelog - Issues - Documentation
Why?
I find myself merging bits of different PDFs fairly regularly and really wanted a simple CLI way to do it.
Install
python -m pip install pdfmerge
Usage
$ pdfmerge [-h] [--version] [-o FILE|--output FILE] [-p PASSWORD|--password PASSWORD] PATH[RULE[, RULE ...]] [PATH[RULE, ...]] ...]
-
-o,--outputoutput file (default:output.pdf). Must not be any of the input files. -
-p, '--password` password for encrypted files (default: empty string). -
PATHa file, directory, or wildcard string (e.g.,file*.pdf) of files to merge. -
RULEan optional string indicating which pages to extract and rotate. The syntax for each rule is:[START][..][END][ROTATE]Where
STARTandENDare positive (1-based) or negative page numbers andROTATEis one of>,V, or<indicating a clockwise rotation of 90, 180, 270 degrees, respectively.
Command-line Example
$ pdfmerge -o out.pdf file1.pdf file2.pdf[3,3] file2.pdf[1V,2..-1] "other*.pdf[<]" "/path/pdf[1..4>,5]"
This example illustrates several features:
- specifying an output file (must not be any of the input files)
- merging multiple files, some more than once
- splicing parts of file using indices (1-based; negatives allowed)
- including the same page multiple times
- rotating a page or page range
- merging all the PDFs in a directory
Python Module Usage
pdfmerge can also be imported into python scripts.
from pdfmerge import pdfmerge
pdfmerge(["pdf-1.pdf", "pdf-2.pdf[2>]"], "output.pdf")
License
Metadata
Release files for pdfmerge 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 | Actions |
|---|---|---|---|---|
| pdfmerge-1.0.0.tar.gz | 8.5 kB | Without provenance | Details for pdfmerge-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdfmerge-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pdfmerge-1.0.0-py3-none-any.whl |
Total release size: 16.8 kB
Release files / pdfmerge-1.0.0.tar.gz
| Download URL | pdfmerge-1.0.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5641742b4d6c4512dd6459282f45de6e7ac8c8374bf7404809f050d5fa24eefd
|
|
BLAKE2b-256 checksum How to use checksums |
5550e9751e29937fb5470fe874547c0d81c02defe8b0c3463255423772562332
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / pdfmerge-1.0.0-py3-none-any.whl
| Download URL | pdfmerge-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eca68c41af5cb89d78727932994ae6ef5f858f9e5459509300adf93d726e9e8e
|
|
BLAKE2b-256 checksum How to use checksums |
fb2844abc95682aee12ca3fc4672e9a01005770c96e5aeb8a10ddbcee9240433
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for pdfmerge 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.
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.