Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pdf-compressor

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf-compressor

CLI + Python API for batch compressing PDFs with iLovePDF.com

  • 0.2.1
  • PyPI
  • Socket score

Maintainers
1

PDF Compressor

Tests pre-commit.ci status PyPI Requires Python 3.8+ PyPI Downloads

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

FlagsDefaultDescription
-i/--inplaceFalseWhether 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-keySet the public key needed to authenticate with the iLovePDF API. You only need to do this once to start using.
--report-quotaReport the number of remaining file operations in the current billing cycle for the stored iLovePDF API key.
--debugFalseWhen true, iLovePDF won't process the request but only reports the parameters that would have been sent to the server.
--verboseFalseWhen true, progress will be reported while tasks are running.
-v/--versionGet the version number of pdf-compressor.
--on-no-pdfs'ignore'What to do when no input PDFs received. One of 'ignore' or 'error', former exits 0, latter raises ValueError. Can be useful when using pdf-compressor in shell scripts.
--on-bad-files'error'How to behave when receiving input files that don't appear to be PDFs. One of 'error', 'warn', 'ignore'. Error type will be ValueError. Code used to check if something is PDF: filepath.lower().endswith(".pdf")

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc