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:

#!/usr/bin/env python3

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 External application Required for PDF and Postscript support.
Pillow 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.2.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

tkDocViewer-1.0.2-py2.py3-none-any.whl (16.5 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: tkDocViewer-1.0.2.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for tkDocViewer-1.0.2.tar.gz
Algorithm Hash digest
SHA256 94589c75a5a4797b01b05392d1cc4ba98534625e1fabe799bbaf1e8aa84a27bc
MD5 f448a9a82aabf1d9ccc13e701f460d66
BLAKE2b-256 3c09c89b6ff8eee86c75d6b10ee2e45deebda144bc74c83adc4e52cacb736728

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tkDocViewer-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for tkDocViewer-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c488ebae1350050e099b7a7222b5609f539953943316c2f1dab53964359c0320
MD5 67571962c7172a819282c7395ed99f6b
BLAKE2b-256 ee2b2216f67367610747f8f8273855fbc8eb30942e0e1315f0426deb22a666df

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