Skip to main content

Interactive TUI for exploring PDF object structure

Project description

pdftree

A Text User Interface for inspecting and modifying PDF object structures. Built with Python, Textual, and pikepdf.

Features

  • Tree Inspection: Navigate the internal dictionary, array, and stream structures of PDF files using Vim-style keybindings.

  • Stream Decoding: Decompresses and displays the raw text of PDF content streams in a secondary pane: navigate to a stream and press enter.

  • Stream Editing: Press e on a stream node to extract it to a temporary file, open it in your local $EDITOR, and inject the saved changes back into the PDF.

  • Stream Normalization: Press f to format dense content streams, parsing the data to place one PDF operator per line.

  • Stream and Image Extraction: Press s to save an uncompressed stream to disk, or x to extract an image stream.

  • Reference Navigation: Follow object references (e.g., /Parent) via interactive links, or jump to specific pages using g.

  • Search: Search forward (/) and backward (?) through tree node labels.

Installation

pdftree requires Python 3.10 or higher.

Install it globally using pipx (recommended for CLI tools):

pipx install pdftree

Or install it via standard pip:

pip install pdftree

Usage

Launch the TUI by passing the path to any PDF file:

pdftree path/to/document.pdf

Keybindings

You can press F1 or H at any time inside the app to bring up this cheat sheet.

Key Action
F1 / H Show/Hide the help menu
/ Search forward
? Search backward
n / p Repeat search forward / backward
Esc / Ctrl+G Cancel search or close modals
j / k / / Navigate tree vertically
h / Collapse node / Jump to parent
l / Expand node / Jump to first child
g Go to page...
s Save stream content to disk
f Format/normalize stream content
e Edit stream content in $EDITOR
w Save the modified PDF to disk
x Extract image to disk
Enter Follow link / Open stream
Ctrl+Z Suspend process
Ctrl+L Force screen redraw
q / Ctrl+C Quit application (prompts if unsaved changes)

License

MPL-2.0

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

pdftree-0.2.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

pdftree-0.2.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file pdftree-0.2.0.tar.gz.

File metadata

  • Download URL: pdftree-0.2.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdftree-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0965978f0e3988b409fedd6a4d2fcba832ca0f8c147a5e620c45c2c705d1f5b3
MD5 f58261f240048dedc18d49d879f2dc91
BLAKE2b-256 f8321fc3a21984519330883361bd6c733f23202ec015d7dff1df8e662bda7d41

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdftree-0.2.0.tar.gz:

Publisher: publish.yml on qooxzuub/pdftree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdftree-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pdftree-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdftree-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 854b73ef3872f801388d8b8f9204bc4a9b0a6b7acb88674ef1580e98de800a32
MD5 7e6e58936a02b63718d8b4d5d78e13a0
BLAKE2b-256 c6dcc51cd2dfd9d101a337017a7ce724e4d72c9e836cfeeecaa8e44ea6b5ac1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdftree-0.2.0-py3-none-any.whl:

Publisher: publish.yml on qooxzuub/pdftree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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