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:

# 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 this README file
v.display_file("README")

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

For more 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.

* 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.


Copyright and License
---------------------

tkDocViewer is released under the MIT License. See the LICENSE file
for more information.

Third-party Python modules (i.e., not part of the standard library)
used by tkDocViewer are licensed under similarly permissive terms.
See each module's documentation for details.

External applications may have different license terms. For example,
as of this writing (2018-08-18) Ghostscript uses the GNU Affero GPL.
See each application's documentation for details.


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.tar.gz (15.1 kB view hashes)

Uploaded Source

Built Distribution

tkDocViewer-1.0-py2.py3-none-any.whl (17.9 kB view hashes)

Uploaded Python 2 Python 3

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