Base (Private) Module: objects/_slideobject.py
- Purpose:
This module provides the implementation for the
SlideObjectobject.- Platform:
Linux/Windows | Python 3.10+
- Developer:
J Berendt
- Email:
- Comments:
n/a
- class SlideObject(pageno: int = 0, parser: object = None)[source]
Bases:
objectThis class provides the implementation for the
SlideObject.For each slide in a document (e.g. PowerPoint), an instance of this class is created, populated and appended into the PPTX document’s
slideslist attribute.- Parameters:
pageno (int, optional) – Page number. Defaults to 0.
parser (object, optional) – The underlying document parser object. Defaults to None.
Tip
To display the textual contents of a slide, simply call the following, where 42 is the slide to be displayed:
>>> print(*pptx.doc.slides[42].texts, sep='\n\n')
- property content: str
Accessor to the textual content of a slide.
- Returns:
A concatenated string for all text objects found on the slide; each object separated by a double-newline.
- Return type:
str
- property images: list
Accessor to a slide’s image objects.
- property pageno: int
Accessor to the page number.
Note
This is the page number with regard to the page’s sequence in the overall document. This is not guaranteed to be the page’s number per the document’s page labeling scheme.
- property parser: object
Accessor to the document parser’s internal functionality.
Note
The population of this property is determined by the document-type-specific
docpparser. If the underlying parsing library has functionality worth preserving and making available to the user, it is stored to this property. Otherwise, this property will remain asNone.
- property tables: list
Accessor to a slide’s table objects.
- property texts: list
Accessor to a slide’s text objects.