zooui.objects.mediaobjects.pdfmediaobject module

Multi-page PDF rendered as individually tiled pages with page navigation.

class zooui.objects.mediaobjects.pdfmediaobject._BlockingConverter[source]

Bases: object

Dummy converter whose progress never reaches 1.0.

Used to prevent TiledMediaObject.render() from calling __run_tiler() while PdfMediaObject manages page-specific tiling externally.

progress = 0.0
class zooui.objects.mediaobjects.pdfmediaobject.PdfMediaObject(pdf_path, scene, autofit=True, start_page=0)[source]

Bases: TiledMediaObject

Constructor :

PdfMediaObject(pdf_path, scene, autofit, start_page)

Parameters :

pdf_path : str scene : Scene autofit : bool (default=True) start_page : int (default=0)

PdfMediaObject(pdf_path, scene, autofit, start_page) –> None

A multi-page PDF rendered as individually tiled pages in the ZUI.

Each page is rasterized as a separate PPM and tiled independently. Page navigation is controlled via Ctrl+Up/Down and Ctrl+Alt+G (go to page).

A lazy 2-page tiling buffer tiles the current page and the next page, providing instant display on forward navigation.

Constructor :

PdfMediaObject(pdf_path, scene, autofit, start_page)

Parameters :

pdf_path : str scene : Scene autofit : bool (default=True) start_page : int (default=0)

PdfMediaObject(pdf_path, scene, autofit, start_page) –> None

Initialize a new PdfMediaObject from the PDF at pdf_path.

Sets up deferred initialization — the PDF is converted in a background process, then pages are tiled lazily with a 2-page buffer.

property current_page

Zero-based index of the current page.

property page_count

Total number of pages in the PDF (0 while loading).

property current_page_label

Human-readable page label, e.g. ‘Page 3/42’.

change_page(delta)[source]

Navigate by delta pages (-1 = previous, +1 = next).

_try_load()[source]

Override to apply smart positioning when a page finishes loading.

go_to_page(page_number)[source]

Jump directly to a page (1-indexed).

handle_key(key, modifiers)[source]

Handle page navigation keys. Returns True if consumed.

render(painter, mode)[source]

Override render to manage page lifecycle and prevent premature tiling.

_on_conversion_complete()[source]

Handle PDF conversion completion: discover pages and start tiling.

_check_conversion_complete()[source]

Check if the PDF conversion process has finished.

_check_page_tiling()[source]

Check if the current page’s tiling process has finished.

_ensure_page_tiling(page_idx)[source]

Ensure that a page has been submitted for tiling, unless already done.

_maintain_buffer()[source]

Maintain 2-page lazy buffer: current page + next page.

_start_tiling_page(page_idx)[source]

Submit a tiling job for a specific page’s PPM.

_show_go_to_page_dialog()[source]

Show a dialog to jump to a specific page number.