Ludochaordic
Fantaisies programatico-ludiques

Spotlight on pdfly, the Swiss Army knife for PDF files

pdfly logo

Project documentation: pdfly.readthedocs.io

pdfly is the youngest project of the py-pdf organization. It has been created by Martin Thoma in 2022.

It's simply a CLI tool to manipulate PDF files, written in Python and based on the fpdf2 & pypdf libraries.

I'm a maintainer of the project ๐Ÿ™‚

What can it do?

It has meany features, including:

$ pdfly meta minimal-document.pdf
                      Operating System Data
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ         Attribute โ”ƒ Value                     โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚         File Name โ”‚ /tmp/minimal-document.pdf โ”‚
โ”‚  File Permissions โ”‚ -rw-r--r--                โ”‚
โ”‚         File Size โ”‚ 16,978 bytes              โ”‚
โ”‚     Creation Time โ”‚ 2025-10-13 09:44:32       โ”‚
โ”‚ Modification Time โ”‚ 2025-10-13 09:44:32       โ”‚
โ”‚       Access Time โ”‚ 2025-10-13 09:44:46       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       PDF Data
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ          Attribute โ”ƒ Value                                                    โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚       CreationDate โ”‚ 2022-04-03 18:05:42+02:00                                โ”‚
โ”‚            Creator โ”‚ TeX                                                      โ”‚
โ”‚           Producer โ”‚ pdfTeX-1.40.23                                           โ”‚
โ”‚              Pages โ”‚ 1                                                        โ”‚
โ”‚          Encrypted โ”‚ None                                                     โ”‚
โ”‚   PDF File Version โ”‚ %PDF-1.5                                                 โ”‚
โ”‚        Page Layout โ”‚                                                          โ”‚
โ”‚          Page Mode โ”‚                                                          โ”‚
โ”‚             PDF ID โ”‚ ID1=b'q\x96\xc3\xe3U\xc1|\x9fS\xba\x9a\r\xcap\xcd\xd0'   โ”‚
โ”‚                    โ”‚ ID2=b'q\x96\xc3\xe3U\xc1|\x9fS\xba\x9a\r\xcap\xcd\xd0'   โ”‚
โ”‚ Fonts (embedded) โ”‚                                                          โ”‚
โ”‚   Fonts (embedded) โ”‚ /KNEUFH+CMR10                                            โ”‚
โ”‚        Attachments โ”‚ []                                                       โ”‚
โ”‚             Images โ”‚ 0 images (0 bytes)                                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • pdfly can also combine files into new PDF documents: it can extract specific pages & merge documents (pdfly cat); selectively remove pages (pdfly rm); convert images to PDF documents (pdfly x2pdf); and even compress documents (pdfly compress) or build booklets (pdfly 2-up & pdfly booklet).

  • pdfly includes some commands to pull out specific content from PDF files: pdfly extract-images & pdfly extract-annotated-text.

  • sometimes you want to edit a PDF file manually, in a text editor. But when you do so, you break its xref table, that is an index of byte offsets in the document. pdfly update-offsets is there to save the day, fixing manually-edited PDF documents, so that they can be opened in a PDF viewer again!

Release 0.5.0 & new features

Today we released a new version: pdfly release 0.5.0.

Thanks to several contributors, including developers taking part in Hacktoberfest, new exciting features have been added:

What's next?

We have a bunch of feature ideas: up-for-grabs issues, including some good first issues aimed specially at new contributors, that are willing to help but new to open-source.

Personally, I think the pdfly sign & check-sign could become handy to many end-users, and I think we should continue to extend those commands usage options, as described in issue #71.

We would also be happy to get your feedbacks, bug reports & feature suggestions! ๐Ÿ™‚