Problem
There is no API for slide footers, slide numbers, dates, or watermarks despite these being basic compliance / branding requirements in regulated-industry decks. Slide footers (<p:hf>) and the field placeholders (<a:fld> for slide-number, date, time) round-trip on read but cannot be set or queried. Watermarks (which in PPT are typically a large semi-transparent text shape on the master) can be authored only via the lower-level shape API. There has been an open PR for <a:fld> since 2022 (scanny/python-pptx#797, 812 LOC) but the diff is XML-fixture-heavy and needs careful rebase.
Sub-features
Prior art
- Open PRs: scanny/python-pptx#797
<a:fld> for page nums + dates (LillianJensen, 812 LOC, last activity 2024-02 — needs rebase but core design is correct).
- User issues this would close: #201, #641, #793.
- OOXML: PresentationML §19.3.1.18
<p:hf> (slide-number/date/footer/header), §19.3.1.51 <p:sldNum>/<p:dt>/<p:ftr> placeholder types, DrawingML §21.1.2.2.5 <a:fld> (id, type=slidenum/datetime1/datetimeN/title).
- Code paths: new
src/pptx/header_footer.py, src/pptx/slide.py, src/pptx/oxml/slide.py, src/pptx/oxml/text.py (<a:fld>).
Acceptance criteria
pres.set_footer("Confidential", slide_number=True, exclude_title_slide=True) produces footers visible on every non-title slide.
- Slide number
<a:fld type="slidenum"> auto-updates when slides are reordered.
- 12+ unit tests + 4 behave scenarios.
- Documentation page in
docs/user/.
Effort: M
Problem
There is no API for slide footers, slide numbers, dates, or watermarks despite these being basic compliance / branding requirements in regulated-industry decks. Slide footers (
<p:hf>) and the field placeholders (<a:fld>for slide-number, date, time) round-trip on read but cannot be set or queried. Watermarks (which in PPT are typically a large semi-transparent text shape on the master) can be authored only via the lower-level shape API. There has been an open PR for<a:fld>since 2022 (scanny/python-pptx#797, 812 LOC) but the diff is XML-fixture-heavy and needs careful rebase.Sub-features
Slide.footer.textgetter+setterSlide.has_slide_numberboolean toggleSlide.has_datetoggle andSlide.date_format(fixed / auto-update + format mask)Presentation.set_footer(text, slide_number=True, date=True, exclude_title_slide=True)— apply across all slides + masterMaster.footer/Master.has_slide_numberfor master-level defaults<a:fld>field-placeholder support — emits page numbers, dates, times in run text with auto-updateMaster.add_watermark(text, font, opacity, rotation)convenience helperPrior art
<a:fld>for page nums + dates (LillianJensen, 812 LOC, last activity 2024-02 — needs rebase but core design is correct).<p:hf>(slide-number/date/footer/header), §19.3.1.51<p:sldNum>/<p:dt>/<p:ftr>placeholder types, DrawingML §21.1.2.2.5<a:fld>(id, type=slidenum/datetime1/datetimeN/title).src/pptx/header_footer.py,src/pptx/slide.py,src/pptx/oxml/slide.py,src/pptx/oxml/text.py(<a:fld>).Acceptance criteria
pres.set_footer("Confidential", slide_number=True, exclude_title_slide=True)produces footers visible on every non-title slide.<a:fld type="slidenum">auto-updates when slides are reordered.docs/user/.Effort: M