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
eon 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
fto format dense content streams, parsing the data to place one PDF operator per line. -
Stream and Image Extraction: Press
sto save an uncompressed stream to disk, orxto extract an image stream. -
Reference Navigation: Follow object references (e.g.,
/Parent) via interactive links, or jump to specific pages usingg. -
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a420e53851d641a9eee28b32a81eb53a8bc029b187f28615ce5c7184ec0e6b7
|
|
| MD5 |
4da13f036b22d932911bcf207ef11ff4
|
|
| BLAKE2b-256 |
04d7dfcf1bdc25590ec70e68a889eeb4c532afbfd11efaaf5aef94de71ff8973
|
Provenance
The following attestation bundles were made for pdftree-0.2.1.tar.gz:
Publisher:
publish.yml on qooxzuub/pdftree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdftree-0.2.1.tar.gz -
Subject digest:
8a420e53851d641a9eee28b32a81eb53a8bc029b187f28615ce5c7184ec0e6b7 - Sigstore transparency entry: 1298334427
- Sigstore integration time:
-
Permalink:
qooxzuub/pdftree@d27bf7f927cf6fbf49c0fc737a5279c719a5aa6c -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/qooxzuub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d27bf7f927cf6fbf49c0fc737a5279c719a5aa6c -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a068435a9027c81c1913e43ff3f4ea6b2740550b43326a3b07342ef7c1d1428a
|
|
| MD5 |
4e2b31659d73238313498bf6e53dbfdb
|
|
| BLAKE2b-256 |
6953a419e9bf5f095aadc93d3cbbb83abab369b1ac5f591f10fecaa8b7207ad2
|
Provenance
The following attestation bundles were made for pdftree-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on qooxzuub/pdftree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdftree-0.2.1-py3-none-any.whl -
Subject digest:
a068435a9027c81c1913e43ff3f4ea6b2740550b43326a3b07342ef7c1d1428a - Sigstore transparency entry: 1298334532
- Sigstore integration time:
-
Permalink:
qooxzuub/pdftree@d27bf7f927cf6fbf49c0fc737a5279c719a5aa6c -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/qooxzuub
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d27bf7f927cf6fbf49c0fc737a5279c719a5aa6c -
Trigger Event:
push
-
Statement type: