python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

feature: Presentation sections

Open ygbr opened this issue 8 years ago • 9 comments

Hi, Is there a way to create sections as in PowerPoint slides bar and organize slides within them?

I've opened the PPTX and see that sections are written on the presentation.xml file under p:presentation > p:extLst > p:ext > p14:sectionLst

It is composed of p14:section tags (with the name attribute referring to the name of sections defined inside PowerPoint) and a p14:sldIdLst element with several <p14:sldId id="256"/> tags bearing the slide Ids for the elements within each section.

Example:

<p:extLst>
        <p:ext uri="{521415D9-36F7-43E2-AB2F-B90AF26B5E84}">
            <p14:sectionLst xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main">
                <p14:section name="Default Section" id="{B824E770-5894-E44B-8038-281771C6AE81}">
                    <p14:sldIdLst>
                        <p14:sldId id="256"/>
                        <p14:sldId id="258"/>
                        <p14:sldId id="259"/>
                        <p14:sldId id="260"/>
                        <p14:sldId id="261"/>
                        <p14:sldId id="262"/>
                        <p14:sldId id="263"/>
                        <p14:sldId id="264"/>
                        <p14:sldId id="265"/>
                        <p14:sldId id="266"/>
                        <p14:sldId id="267"/>
                        <p14:sldId id="268"/>
                        <p14:sldId id="269"/>
                        <p14:sldId id="270"/>
                        <p14:sldId id="271"/>
                        <p14:sldId id="272"/>
                        <p14:sldId id="273"/>
                        <p14:sldId id="274"/>
                        <p14:sldId id="275"/>
                        <p14:sldId id="276"/>
                        <p14:sldId id="277"/>
                        <p14:sldId id="278"/>
                        <p14:sldId id="279"/>
                        <p14:sldId id="280"/>
                        <p14:sldId id="281"/>
                        <p14:sldId id="282"/>
                        <p14:sldId id="283"/>
                        <p14:sldId id="284"/>
                        <p14:sldId id="285"/>
                    </p14:sldIdLst>
                </p14:section>
                <p14:section name="Q4" id="{EEB87577-7894-4F4B-96EE-0D3BBFA5AA16}">
                    <p14:sldIdLst>
                        <p14:sldId id="287"/>
                        <p14:sldId id="286"/>
                    </p14:sldIdLst>
                </p14:section>
                <p14:section name="Q5" id="{2542D0E8-2F7C-6F4C-ACE2-21FDBA1D7D14}">
                    <p14:sldIdLst/>
                </p14:section>
                <p14:section name="TeslaUnit" id="{8737AFB4-F334-3647-B670-FC902FD53CFF}">
                    <p14:sldIdLst>
                        <p14:sldId id="257"/>
                    </p14:sldIdLst>
                </p14:section>
            </p14:sectionLst>
        </p:ext>
</p:extLst>

If not yet possible, can this be turned into a feature?

ygbr avatar Jan 25 '17 03:01 ygbr