class openlp.plugins.presentations.lib.pdfcontroller.PdfController(plugin)[source]

Bases: openlp.plugins.presentations.lib.presentationcontroller.PresentationController

Class to control PDF presentations


PdfController is able to run on this machine.

Returns:True if program to open PDF-files was found, otherwise False.

Check the viewer is installed.

Returns:True if program to open PDF-files was found, otherwise False.

Called at system exit to clean up any running presentations

static process_check_binary(program_path)[source]

Function that checks whether a binary is either ghostscript or mudraw or neither. Is also used from presentationtab.py

:param program_path:The full path to the binary to check. :return: Type of the binary, ‘gs’ if ghostscript, ‘mudraw’ if mudraw, None if invalid.

class openlp.plugins.presentations.lib.pdfcontroller.PdfDocument(controller, presentation)[source]

Bases: openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument

Class which holds information of a single presentation. This class is not actually used to present the PDF, instead we convert to image-serviceitem on the fly and present as such. Therefore some of the ‘playback’ functions is not implemented.


Close presentation and clean up objects. Triggered by new object being added to SlideController or OpenLP being shut down.


Generates thumbnails


Returns total number of slides

Returns:The number of pages in the presentation..

Only used when using ghostscript Ghostscript can’t scale automatically while keeping aspect like mupdf, so we need to get the ratio between the screen size and the PDF to scale

Parameters:size – Size struct containing the screen size.
Returns:The resolution dpi to be used.

Returns true if a presentation is currently active.

Returns:True if active, False if not.

Returns true if a presentation is loaded.

Returns:True if loaded, False if not.

Called when a presentation is added to the SlideController. It generates images from the PDF.

Returns:True is loading succeeded, otherwise False.