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.1.tar.gz (17.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.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdftree-0.2.1.tar.gz
  • Upload date:
  • Size: 17.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.1.tar.gz
Algorithm Hash digest
SHA256 8a420e53851d641a9eee28b32a81eb53a8bc029b187f28615ce5c7184ec0e6b7
MD5 4da13f036b22d932911bcf207ef11ff4
BLAKE2b-256 04d7dfcf1bdc25590ec70e68a889eeb4c532afbfd11efaaf5aef94de71ff8973

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdftree-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pdftree-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a068435a9027c81c1913e43ff3f4ea6b2740550b43326a3b07342ef7c1d1428a
MD5 4e2b31659d73238313498bf6e53dbfdb
BLAKE2b-256 6953a419e9bf5f095aadc93d3cbbb83abab369b1ac5f591f10fecaa8b7207ad2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdftree-0.2.1-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