Skip to main content

A command line utility for easily modifying PDF files

Project description

Simple command line PDF editor

pdfriend is a simple command line program for editing PDF files at the page level. It can, among other things:

  • merge many PDFs, PNGs and JPGs into a single PDF
  • split a PDF into different parts
  • exctract images from PDFs
  • select pages from a PDF
  • rotate PDF pages
  • delete PDF pages
  • change the order of pages in a PDF
  • encrypt and decrypt PDFs
  • see and edit PDF metadata

Installation

The recommended way to install pdfriend is through pipx. Simply run:

pipx install pdfriend

You need a working python 3.11 or newer installation.

Alternatively, you can install it as you would any other PyPI package, for example using pip:

pip install pdfriend

Usage

To access instructions for the usage of pdfriend:

pdfriend help

As a quick overview:

Merging PDFs and images

PDFs:

pdfriend merge doc0.pdf doc1.pdf -o output.pdf

Images:

pdfriend merge img0.png img1.jpg img2.png img3.png -o output.pdf

PDFs and images:

pdfriend merge doc0.pdf img0.png doc32.pdf -o comb.pdf

Glob patterns are also supported:

pdfriend merge input_dir/*.png -o output.pdf

Editing PDFs

To edit a PDF file in place, enter the edit shell:

pdfriend edit doc.pdf

You can then use the edit subcommands, for example

rotate 12 90

To rotate page 12 by 90 degrees, or

delete 6

To delete page 6, or

swap 3 7

To swap pages 3 and 7, or

undo

To undo the previous command, etc. Use

pdfriend encrypt sus.pdf -o sus-encrypted.pdf

to encrypt the PDF with a password. Use

pdfriend invert wrong.pdf -o right.pdf

to invert the order of the pages in a PDF. Use

help

To see all the available subcommands

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

pdfriend-0.8.0.dev1.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

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

pdfriend-0.8.0.dev1-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file pdfriend-0.8.0.dev1.tar.gz.

File metadata

  • Download URL: pdfriend-0.8.0.dev1.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pdfriend-0.8.0.dev1.tar.gz
Algorithm Hash digest
SHA256 72132600591695a97deb6573367deafaeba4e801258fe108fc0d67571fef1cb2
MD5 2161fe106fbabf4d7e5e3c3b65538454
BLAKE2b-256 845d43bc1c501afe1ee12c8079c81a6af802d02e6191d2f9e9efc18d51272135

See more details on using hashes here.

File details

Details for the file pdfriend-0.8.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: pdfriend-0.8.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pdfriend-0.8.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 931d586141ef022d2ef44adf7c500d533a57f81e0ce8dd6eb65ff1fc01e8e494
MD5 4f2f830a12be9c14cc8b8db2fd82dc45
BLAKE2b-256 e654f2b363163fa742e9c63717cc5c14d3639e05177f4f80f7b8ad56f8615157

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