pdfcontroller

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

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

Class to control PDF presentations

check_available()[source]

PdfController is able to run on this machine.

Returns:True if program to open PDF-files was found, otherwise False.
check_installed()[source]

Check the viewer is installed.

Returns:True if program to open PDF-files was found, otherwise False.
kill()[source]

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()[source]

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

create_thumbnails()[source]

Generates thumbnails

get_slide_count()[source]

Returns total number of slides

Returns:The number of pages in the presentation..
gs_get_resolution(size)[source]

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.
is_active()[source]

Returns true if a presentation is currently active.

Returns:True if active, False if not.
is_loaded()[source]

Returns true if a presentation is loaded.

Returns:True if loaded, False if not.
load_presentation()[source]

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

Returns:True is loading succeeded, otherwise False.