Skip to content

Itreza2/TkPdfWidget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 :

TkPDF_Exemple

Intallation

Download the latest package on github or, using pip :

pip install TkPdfWidget

Features :

  • 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)

Known alternatives :

Do not hesitate to have a look to these other projects that may better suit your needs

How does it work ?

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()

Dependancies :

About

An extention of tkinter that offer a PDF reader emulating a Tk Widget

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages