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
ConvertPdf2Pngclass 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
562387103194829b65cab7e215aecbca951f7ed0ef1bba4f85679e403ca16f41
|
|
| MD5 |
7419bafc180f5298512e9f1b8528989e
|
|
| BLAKE2b-256 |
15212e90f248ff72ea1087c6745372ed983bf41d5f67e1708f9c81e763af5ffb
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd0efb0389418454bca6be18276ecd6de7d9b237c39f79231d51d0c499aeecce
|
|
| MD5 |
3a1db67d8f66c9ac3240a2390e255eba
|
|
| BLAKE2b-256 |
4a2c81f7476c54117301cacd7a8f8eb1a032c02964d6e41b9cf85233701685b2
|