Powerpoint¶
flowtask.interfaces.powerpoint
¶
PowerPointClient
¶
Bases: ABC
append_slides_to_presentation
staticmethod
¶
Edit a PowerPoint file to append more slides from an iterator.
:param file_path: Path to the existing PowerPoint file. :param slide_contents: An iterator where each item is a dict with content for a slide.
create_empty_presentation
staticmethod
¶
Create an empty PowerPoint presentation.
:param file_path: Path where the new PowerPoint file will be saved.
create_presentation_from_template
¶
create_presentation_from_template(template_path, slide_contents, file_path, default_master_index=0, default_layout_index=1)
Create a presentation from a template, adding texts or images per slide.
:param template_path: Path to the PowerPoint template file. :param slide_contents: An iterator where each item is a dict with content for a slide. :param file_path: Path where the new PowerPoint file will be saved. :param default_layout_index: Default slide layout index to use if not specified per slide.
create_presentation_from_text_list
staticmethod
¶
Create a PowerPoint file where each slide contains text from a list.
:param text_list: List of texts to add to slides. :param file_path: Path where the new PowerPoint file will be saved.
create_slide
staticmethod
¶
create_slide(text_content=None, image_path=None, image_size=None, font_size=18, font_color='000000', font_name='Calibri', layout_index=None)
Create a slide content dictionary.
:param text_content: Text to include in the slide. :param image_path: Path to the image file to include in the slide. :param image_size: Tuple of three elements (left, top, width) for image positioning. :param font_size: Font size for the text. :param font_color: Font color for the text in hex format (e.g., 'FF0000' for red). :param font_name: Font name for the text. :param layout_index: Optional index of the slide layout to use for this slide. :return: A dictionary representing the slide content.