CLI + Python API for batch compressing PDFs with iLovePDF.com
Project description
Command line PDF compression powered by the free iLovePDF API.
Why? iLovePDF delivers the best PDF compression I've seen but their web UI doesn't support automation and can be cumbersome when dealing with many files.
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.9.tar.gz
(11.6 kB
view details)
File details
Details for the file pdf-compressor-0.1.9.tar.gz
.
File metadata
- Download URL: pdf-compressor-0.1.9.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f82f1c53c28866387d0512b990bbf8701a91e36482249d0902c9448370285c7 |
|
MD5 | 58fdff61dc181c0301f991f5a727e964 |
|
BLAKE2b-256 | f75f262f7f2c75dc6702df1291cd88fcea58b2570c762c55f028bab9a13d6f05 |