Skip to main content

Document viewer widget for Tkinter

Project description

**tkDocViewer** is a document viewer widget for Python + Tkinter. It is primarily intended for displaying file previews.

Currently supported file types include:

* Plain text
* PDF, Postscript (requires an external Ghostscript binary)
* PNG, GIF, JPEG (requires PIL)

tkDocViewer is designed to be simple above all else. All dependencies outside the Python standard library are optional (though file type support will be limited). Its API is designed to let you accomplish tasks with as few method calls as possible.

This emphasis on simplicity does come with some performance costs. It is not necessarily the fastest nor the most resource-efficient viewer, but it should generally run well enough to get the job done.

Both Python 2 and 3 are supported, on Windows and Unix platforms.


## Usage

tkDocViewer consists of a single module, `tkdocviewer` (note the module name is lowercase), which exports a single class, `DocViewer`.

A brief example program:

```python
# This assumes Python 3
from tkinter import *
from tkdocviewer import *

# Create a root window
root = Tk()

# Create a DocViewer widget
v = DocViewer(root)
v.pack(side="top", expand=1, fill="both")

# Display some document
v.display_file("example.pdf")

# Start Tk's event loop
root.mainloop()
```

For detailed documentation, try `python -m pydoc tkdocviewer`.


## Dependencies

Most file formats require third-party modules or external applications. tkDocViewer will still run without them, but file format support will be limited by what's available on your system.

Name | Type | Notes
---- | ---- | -----
[Ghostscript](https://ghostscript.com/) | External application | Required for PDF and Postscript support.
[Pillow](https://python-pillow.org/) | Python module | Required for most image formats; optional for PDF support.


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

tkDocViewer-1.0.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

tkDocViewer-1.0.1-py2.py3-none-any.whl (17.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tkDocViewer-1.0.1.tar.gz.

File metadata

  • Download URL: tkDocViewer-1.0.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4

File hashes

Hashes for tkDocViewer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cb300ce8c9427a00adffeba6bac1e609ca41d02c0cc8fbb718a55acd374964bd
MD5 8a3fa12ed2f6bddff875b3e4beebae3d
BLAKE2b-256 0cbd68a4706bf896e9d3f4ee3bbb3b37a17a5cc3a2d7dfd7155495e8a7023162

See more details on using hashes here.

File details

Details for the file tkDocViewer-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: tkDocViewer-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4

File hashes

Hashes for tkDocViewer-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1a54c1c48705a71dc2c84d294ac4a2a4de15695ad98c77f093c503e94712c055
MD5 5430b3fa99702d4d0956bc1947740db3
BLAKE2b-256 7c13abefb274030faf6db0b9c467a4ad48d6571a6af95a125877408226937370

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page