Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GUI scripts to display a PDF using wxPython or Tkinter

Jorj X. McKie edited this page Jun 25, 2020 · 8 revisions

PDFdisplay.py (wxPython)

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.

Changes in PyMuPDF v1.9.2

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.

Using wxPython-Phoenix

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.

New since August 2018: A GUI for Tkinter

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, ...).

doc-browser.py

Recipes

HOWTO Button annots with JavaScript

HOWTO extract images

HOWTO join PDFs

HOWTO work with PDF embedded files

HOWTO Convert Images

HOWTO extract text from inside rectangles

HOWTO extract text in natural reading order

HOWTO add PDF form fields

HOWTO deal with annotations

HOWTO convert to PDF

HOWTO show PDF Form fields

HOWTO work with vector images

HOWTO create or extract graphics

HOWTO create your own PDF Drawing

HOWTO add pages, images, text

HOWTO extract fonts

HOWTO rearrange pages

HOWTO GUI PDF display

Algebra with geometry objects

Rectangle inclusion & intersection

Hyperlink maintenance

Visual table extraction

Incremental saves

Metadata & bookmark maintenance

Wrapping FileOptimizer

Installation

Ubuntu

Ubuntu Installation Experience

Windows Binaries

Windows Binaries Generation

Windows Binaries Installation

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /