Significantly reduce the file size of scanned PDF documents without noticeable loss of quality.
Significantly reduce the file size of scanned PDF documents without noticeable loss of quality.
To install the compress-pdf
You can quickly run the project with the following command:
swift run compress-pdf [--replace-files] [--suffix <suffix>] [<files> ...]
You can build compress-pdf for release like so:
swift build --configuration release
compress-pdf
is particullarly effective for documents that were scanned with iPhone.compress-pdf [--replace-files] [--suffix <suffix>] [<files> ...]
ARGUMENTS:
<files> The PDF files to compress.
OPTIONS:
-r, --replace-files Replace original PDF files.
-s, --suffix <suffix> Set file suffix added to copied PDF files. (default: (compressed))
-h, --help Show help information.
input.pdf
and saves it in the file named input (compressed).pdf
.compress-pdf
below:Original File | Compressed File | Percentage Decrease (Bytes) |
---|---|---|
01-scanned-document.pdf (9.5 MB) | 01-compressed.pdf (329 KB) | 96.554% |
02-scanned-document.pdf (12.1 MB) | 02-compressed.pdf (429 KB) | 96.459% |
03-scanned-document.pdf (9.1 MB) | 03-compressed.pdf (312 KB) | 96.552% |
Note: all documents were scanned in the Files iPhone app.