Welcome to pdfly

https://img.shields.io/pypi/v/pdfly.svg https://img.shields.io/pypi/pyversions/pdfly.svg https://img.shields.io/badge/License-BSD%203%20Clause-blue.svg https://app.readthedocs.org/projects/pdfly/badge/?version=latest https://github.com/py-pdf/pdfly/workflows/CI/badge.svg https://img.shields.io/github/last-commit/py-pdf/pdfly https://img.shields.io/github/issues-closed/py-pdf/pdfly https://img.shields.io/github/issues-pr-closed/py-pdf/pdfly https://img.shields.io/badge/linters-black,ruff,mypi-green.svg https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat https://img.shields.io/badge/first--timers--only-friendly-blue.svg

pdfly (say: PDF-li) is a pure-python cli application for manipulating PDF files.

_images/pdfly-logo.png

Repository: github.com/py-pdf/pdfly

Installation

pip install -U pdfly

As pdfly is an application, you might want to install it with pipx or uv tool.

Usage

 $ pdfly --help

 Usage: pdfly [OPTIONS] COMMAND [ARGS]...

 pdfly is a pure-python cli application for manipulating PDF files.

╭─ Options ─────────────────────────────────────────────────────────────────────────────╮
│ --version                                                                             │
│ --help             Show this message and exit.                                        │
╰───────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────╮
│ 2-up                      Create a booklet-style PDF from a single input.             │
│ booklet                   Reorder and two-up PDF pages for booklet printing.          │
│ cat                       Concatenate pages from PDF files into a single PDF file.    │
│ check-sign                Verifies the signature of a signed PDF.                     │
│ compress                  Compress a PDF.                                             │
│ extract-annotated-pages   Extract only the annotated pages from a PDF.                │
│ extract-images            Extract images from PDF without resampling or altering.     │
│ extract-text              Extract text from a PDF file.                               │
│ meta                      Show metadata of a PDF file                                 │
│ pagemeta                  Give details about a single page.                           │
│ rm                        Remove pages from PDF files.                                │
│ rotate                    Rotate specified pages by the specified amount              │
│ sign                      Creates a signed PDF from an existing PDF file.             │
│ uncompress                Module for uncompressing PDF content streams.               │
│ update-offsets            Updates offsets and lengths in a simple PDF file.           │
│ x2pdf                     Convert one or more files to PDF. Each file is a page.      │
╰───────────────────────────────────────────────────────────────────────────────────────╯

You can see the help of every subcommand by typing --help:

 $ pdfly 2-up --help

 Usage: pdfly 2-up [OPTIONS] PDF OUT

 Create a booklet-style PDF from a single input.
 Pairs of two pages will be put on one page (left and right)

 usage: python 2-up.py input_file output_file

╭─ Arguments ───────────────────────────────────────╮
│ *    pdf      PATH  [default: None] [required]    │
│ *    out      PATH  [default: None] [required]    │
╰───────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────╮
│ --help          Show this message and exit.       │
╰───────────────────────────────────────────────────╯

Note

pdfly has nothing to do with pdfly.net or gopdfly.com

Developer Guide

Indices and tables