Skip to main content

Display PDF files in textual widgets!

Project description

Textual PDF

A Textual widget for viewing PDF files.

Installation

Install the package using your package manager:

pip install textual-pdf
uv add textual-pdf
poetry add textual-pdf

Usage

Here is a simple example of how to use the PDFViewer widget in your Textual application:

from textual.app import App, ComposeResult
from textual_pdf.pdf_viewer import PDFViewer

class PDFApp(App):
    def compose(self) -> ComposeResult:
        yield PDFViewer("path/to/your/document.pdf")

app = PDFApp()
app.run()

The PDFViewer class also comes with an option to switch protocols

PDFViewer supports whatever image protocols textual-image supports, which are TGP, Sixel, and Halfcell and Unicode

TGP and Sixel are the most recommended to use as they allow the clearest image to be produced. Halfcell and Unicode are not readable at all, and simply exists for the fun of it.

# use tgp
PDFViewer("path/to/your/document.pdf", protocol="TGP")
# autodetect (default)
PDFViewer("path/to/your/document.pdf", protocol="Auto")

CLI

textual-pdf is available as a CLI tool via ptf

uv tool install git+https://github.com/NSPC911/ptf

License

This project is licensed under the MIT License.

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

textual_pdf-0.1.6.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

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

textual_pdf-0.1.6-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file textual_pdf-0.1.6.tar.gz.

File metadata

  • Download URL: textual_pdf-0.1.6.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for textual_pdf-0.1.6.tar.gz
Algorithm Hash digest
SHA256 83991af1f26d052969c9cc023b2ebd413325d860b27c833e6e65265577c96d99
MD5 68d409a6a05127ce6d77c9125044e45e
BLAKE2b-256 28376217a66c724571d93c0b441dd73c4ae48f6d4a6209e6884325d2170a940b

See more details on using hashes here.

File details

Details for the file textual_pdf-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for textual_pdf-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 74a8a9af74e4c1f544f9c18ee2222e0bc862de44599da81f4547102ff5207cd4
MD5 06c8c43fc97b8cc658aa635054cdc5e1
BLAKE2b-256 c6b1466a4f7585ff964d2367cebe6c6fb93600d0e0178d8319182245ef2cb693

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