Skip to main content

A commandline tool to enhance PDFs from Internet Archive.

Project description

betteria

PyPI version

A commandline tool to enhance PDFs from Internet Archive.

Installation

pip install betteria

Usage

betteria --help
usage: betteria [-h] --input INPUT [--output OUTPUT] [--dpi DPI] [--threshold THRESHOLD] [--block-size BLOCK_SIZE] [--c-val C_VAL] [--adaptive]
                [--invert] [--quiet] [--jobs JOBS] [-v]

Clean and compress a scanned PDF by whitening pages and saving as CCITT Group 4 TIFFs (via a manual page-by-page approach).

options:
-h, --help            show this help message and exit
--input INPUT         Path to input PDF
--output OUTPUT       Path to output PDF (default: <input-stem>-enhanced.pdf)
--dpi DPI             DPI for rasterizing PDF pages (default: 150)
--threshold THRESHOLD
                        Global threshold value (0-255)
--block-size BLOCK_SIZE
                        Odd-sized neighborhood for adaptive thresholding (default: 31)
--c-val C_VAL         Constant subtracted in adaptive thresholding (default: 15)
--adaptive            Use adaptive thresholding instead of a global threshold (default: on)
--invert              Invert pixels before thresholding (for light text on dark background, default: off)
--quiet               Disable progress bars (default: show progress)
--jobs JOBS           Parallel workers for rasterizing and whitening ('auto'/0 uses logical cores; use 1 to disable)
--rasterizer RASTERIZER
                      Poppler rasterizer to use ('pdftoppm' or 'pdftocairo') (default: pdftocairo)
-v, --version         show program's version number and exit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

betteria-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file betteria-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: betteria-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for betteria-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f20b8581a670f3a2f2e39b8c60b8171b55cab1622f615a396aaabebfd2a8978b
MD5 5d9262748673b2e170280546b8b26e7f
BLAKE2b-256 39b3e158877d01a7b1ca67e8d95b2466b9626bf3b50e5dba20bf9374ce48f875

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page