TkPdfWidget is a python librairy extending tkinter with a PDF file reader widget.
Here is an exemple of how it looks like in a minimalist tkinter window :
Download the latest package on github or, using pip :
pip install TkPdfWidget
- Several viewing modes (full width, full page, real size and free move)
- zoom in / out, horizontal and vertical scroll
- 90° pages rotation
- easy access to any page of a document
- keyboard shortcuts (wip)
Do not hesitate to have a look to these other projects that may better suit your needs
You can use this Pdf reader like you would for any standard tkinter's widget. It got the same options and methods than a Frame widget, with a few additions :
- Two options at instantiation : defaultMode (default viewing mode) and filepath (automatic call to the load method below)
- One public method : load (load a new pdf document in the reader)
Here is a quick exemple :
from tkinter import Tk
from TkPdfWidget import PdfReader
tk = Tk()
tk.title("simple example")
reader = PdfReader(tk, width=500, height=600, fp="CodeCivil.pdf")
reader.pack()
tk.mainloop()