Exporters

Presentation.save_pdf and Presentation.save_pptx cover most needs. The exporter classes give access to further options.

class respysive.exporters.PdfExporter(presentation, fragments=False, timeout=60)[source]

Bases: BaseExporter

Export a presentation to PDF, one page per slide.

Pages have the size of the slides and look like the slides on screen: same layout, same overflow fitting, vector text and charts. Requires Playwright and Chromium (pip install playwright then python -m playwright install chromium).

Parameters:
  • presentation – respysive.Presentation object to export

  • fragments (bool) – One page per fragment step instead of the final state

  • timeout (int) – Seconds allowed for loading charts, equations and maps

export(**kwargs)[source]

Render the presentation to PDF.

Parameters:

**kwargs – Presentation.to_html() options (theme, width, height, …).

Return type:

bytes

Returns:

bytes – PDF document.

save(output_path, **kwargs)[source]

Save the presentation as a PDF file.

Parameters:
  • output_path (str) – Path of the PDF file.

  • **kwargs – Presentation.to_html() options (theme, width, height, …).

class respysive.exporters.PptxExporter(presentation, timeout=60, native_charts=True)[source]

Bases: BaseExporter

Export a presentation to PowerPoint (.pptx) from its rendered layout.

Text stays editable; simple Plotly charts (bars, lines, scatter, pies) become native PowerPoint charts; other charts, maps and equations become pictures. Slides have the size of the HTML slides (1280 x 720 px gives 13.333 x 7.5 in, PowerPoint’s 16:9). Requires Playwright and Chromium.

Parameters:
  • presentation – respysive.Presentation object to export

  • timeout (int) – Seconds allowed for loading charts, equations and maps

  • native_charts (bool) – Rebuild simple Plotly charts as editable PowerPoint charts; False keeps every chart as a picture of its rendering

export(**kwargs)[source]

Build the PowerPoint presentation.

Parameters:

**kwargs – Presentation.to_html() options (theme, width, height, …).

Returns:

pptx.Presentation – python-pptx presentation object.

save(output_path, **kwargs)[source]

Save the presentation as a .pptx file.

Parameters:
  • output_path (str) – Path of the PowerPoint file.

  • **kwargs – Presentation.to_html() options (theme, width, height, …).