CLI + Python API for batch compressing PDFs with iLovePDF.com
Project description
The code in
ilovepdf.py
was inspired by Andrea Bruschi'spylovepdf
.
Command line PDF compression powered by the free iLovePDF API.
Installation
pip install pdf-compressor
Usage
First, tell pdf-compressor
your iLovePDF API key (if you haven't yet, get one by signing up at https://developer.ilovepdf.com/signup):
pdf-compressor --set-api-key project_public_7c854a9db0...
Then start compressing!
pdf-compressor **/*.pdf
Options
Flags | Default | Description |
---|---|---|
-i/--inplace |
False |
Whether to compress PDFs in place. |
-s/--suffix |
'-compressed' |
String to append to the filename of compressed PDFs. Mutually exclusive with --inplace . |
--cl/--compression-level |
'recommended' |
How hard to squeeze the file size. One of 'low' , 'recommended' , 'extreme' . 'extreme' noticeably degrades quality of embedded bitmap images. |
--set-api-key |
Set the public key needed to authenticate with the iLovePDF API. You only need to do this once to start using. | |
--report-quota |
Report the number of remaining file operations in the current billing cycle for the stored iLovePDF API key. | |
--debug |
False |
When true, iLovePDF won't process the request but only reports the parameters that would have been sent to the server. |
--verbose |
False |
When true, progress will be reported while tasks are running. |
-v/--version |
Get the version number of pdf-compressor . |
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
pdf-compressor-0.1.7.tar.gz
(10.9 kB
view details)
Built Distribution
File details
Details for the file pdf-compressor-0.1.7.tar.gz
.
File metadata
- Download URL: pdf-compressor-0.1.7.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 823bc14731a8072b33b2eebcb9227508d36b4cbe5bd5e5637a3821e413740351 |
|
MD5 | 5a6728c04d600cb87743c83f4e4b9a80 |
|
BLAKE2b-256 | 43046ad8daa01f4f9af3324e92ce5069b18a6eca1219cd2f2d8ad45eef7acc4b |
File details
Details for the file pdf_compressor-0.1.7-py2.py3-none-any.whl
.
File metadata
- Download URL: pdf_compressor-0.1.7-py2.py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5550214336c27c3ab35a45154e6529e5f5e26c6e1a077af4fb791126db08a0a5 |
|
MD5 | b655cb1da8a7f90bfd1a50b73713b3d1 |
|
BLAKE2b-256 | 624e0bf802643b78959cacbaf940ff572f4e14f92bc83c757a6a9ac5e5f2e7e5 |