Skip to main content

A small utility to generate fairly high resolution preview images of PDFs suitable for viewing or sharing to social media

Project description

pdf2up

A small utility to generate preview images of research papers (e.g. arXiv) suitable for social media (e.g. Twitter)

Installation

To install as a command line tool pdf2up run:

pip install pdf2up

Usage

Run on the command line as pdf2up input.pdf, optionally with the following flags:

usage: pdf2up [-h] [-b BOX [BOX ...]] [--all] [-s SKIP] [-n N_UP] [-c CORES]
              input

positional arguments:
  input

optional arguments:
  -h, --help            show this help message and exit
  -b BOX [BOX ...], --box BOX [BOX ...]
                        to specify a crop box for each pre-cropped 2-up page
                        image, either as 1 side, 2 sides (L/R, T/B), or 4
                        sides (L, T, R, B)
  --all                 override the default of only producing 4 images (which
                        for default 2-up gives 8 pages as 4 PNGs)
  -s SKIP, --skip SKIP  How many pages to skip forward from the original PDF
  -n N_UP, --n-up N_UP  How many pages to 'paste' alongside onto a single page
                        (default: 2)
  -c CORES, --cores CORES
                        Maximum CPU cores to run multicore execution (default:
                        all available cores)

To run as a library using the pdf2up.conversion module:

  • The pdf2png() function gives the same interface as the CLI
  • The ConvertPdf2Png class gives access to values configured by this interface

Development

  • mypy: progressive (does not pass completely)
  • flake8: passing (flake8 . --max-line-length=88 --extend-ignore=E203,)

Project details


Download files

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

Source Distribution

pdf2up-0.2.4.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

pdf2up-0.2.4-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file pdf2up-0.2.4.tar.gz.

File metadata

  • Download URL: pdf2up-0.2.4.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for pdf2up-0.2.4.tar.gz
Algorithm Hash digest
SHA256 562387103194829b65cab7e215aecbca951f7ed0ef1bba4f85679e403ca16f41
MD5 7419bafc180f5298512e9f1b8528989e
BLAKE2b-256 15212e90f248ff72ea1087c6745372ed983bf41d5f67e1708f9c81e763af5ffb

See more details on using hashes here.

File details

Details for the file pdf2up-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: pdf2up-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for pdf2up-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cd0efb0389418454bca6be18276ecd6de7d9b237c39f79231d51d0c499aeecce
MD5 3a1db67d8f66c9ac3240a2390e255eba
BLAKE2b-256 4a2c81f7476c54117301cacd7a8f8eb1a032c02964d6e41b9cf85233701685b2

See more details on using hashes here.

Supported by

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