-
Notifications
You must be signed in to change notification settings - Fork 554
GUI scripts to display a PDF using wxPython or Tkinter
This demonstrates the superior rendering capabilities of MuPDF using wxPython as the display manager.
To access the program, have a look at PDFdisplay.py in the demo folder of the repository.
The program now supports the display of links contained in a page. When activating this option, the next displayed page will mark any link with a blue-lined frame. When clicking such a link, the respective action will be performed. Supported are links within the document (GoTo
), links to other documents (GoToR
, in this case subprocess.Popen
is used to display the requested document with the standard PDF reader), links to web sites (URI
) and named destinations.
When using this newest wxPython version, you can simply use its new pdfviewer
class. This class uses PyMuPDF as its default PDF module (falling back to PyPDF2 if PyMuPDF is unavailable). Here is the sample code provided in the online documentation.
This GUI script is based on Tkinter and the pure Python package PySimpleGUI.
It runs with Python 2 or 3 (you must install PySimpleGUI27 if Python 2).
The script features direct jumping to pages, Next / Previous buttons and - for demonstration purposes - also has some buttons to zoom into quarter pages of the display.
Also note, that not only PDF files can be displayed - support is for all document types (XPS, EPUB, ...).
HOWTO Button annots with JavaScript
HOWTO work with PDF embedded files
HOWTO extract text from inside rectangles
HOWTO extract text in natural reading order
HOWTO create or extract graphics
HOWTO create your own PDF Drawing
Rectangle inclusion & intersection
Metadata & bookmark maintenance