Document viewer widget for Tkinter
Project description
tkDocViewer is an inefficient, yet practical, Tkinter widget for displaying file previews.
It supports a variety of document and image formats; see below for the complete list. Support for new formats can be added through a modular backend system.
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 python3 -m pydoc tkdocviewer
.
Supported Formats
Note: Most file formats require third-party modules or external applications to be present at runtime. tkDocViewer will still work without them, but file format support will be limited by what's available on your system.
Document Formats
Format | Extensions | Requirements | Notes |
---|---|---|---|
.pdf |
Ghostscript | ||
Plain text | .txt |
none | |
Postscript | .ps |
Ghostscript | |
XPS | .xps |
Ghostscript, GhostXPS | OpenXPS has not been tested. |
Image Formats
Format | Extensions | Requirements | Notes |
---|---|---|---|
Bitmap image | .bmp , .pcx |
Pillow | |
GIF | .gif |
Pillow | Animations are displayed as individual frames. |
JPEG | .jpe , .jpg , .jpeg |
Pillow | |
PNG | .png |
Pillow | |
Netpbm | .pbm , .pgm , .pnm , .ppm |
Pillow | |
Targa | .tga |
Pillow | |
TIFF | .tif , .tiff |
Pillow | Supports multi-page documents. |
Windows icon | .ico |
Pillow | |
X bitmap | .xbm |
Pillow |
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
Built Distribution
File details
Details for the file tkDocViewer-2.0.0.tar.gz
.
File metadata
- Download URL: tkDocViewer-2.0.0.tar.gz
- Upload date:
- Size: 20.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8256f230534d4f9aa7a50f7acfe90dcb996f2c53341735877716c786641c102 |
|
MD5 | 4ab7eb04a5ae07df7a137794f29ab542 |
|
BLAKE2b-256 | 9f054462c8aece0364ad4cd2a46696e9ce502cc85937fc9a7f9ff470615f4c62 |
File details
Details for the file tkDocViewer-2.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: tkDocViewer-2.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 26.3 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 788ab0f272b21081b6e241c48631160dea23a03a74f3e2b1f36be2006da86fe6 |
|
MD5 | 6820486f8a547b907fdcdc5df2e57502 |
|
BLAKE2b-256 | eab50d43d53e8639744e5dd40ffacafcdea27e73268ddc2f640484e4ae46fe69 |