Presentation properties

Overview

The presentation object has a few interesting properties. Right now I’m interested in slide size.

Protocol

>>> assert isinstance(prs, pptx.parts.presentation.PresentationPart)
>>> prs.slide_width
9144000
>>> prs.slide_height
6858000
>>> prs.slide_width = 11887200  # 13 inches
>>> prs.slide_height = 6686550  # 7.3125 inches
>>> prs.slide_width, prs.slide_height
(11887200, 6686550)

XML specimens

Example presentation.xml contents:

<p:presentation>
  <p:sldMasterIdLst>
    <p:sldMasterId id="2147483897" r:id="rId1"/>
  </p:sldMasterIdLst>
  <p:notesMasterIdLst>
    <p:notesMasterId r:id="rId153"/>
  </p:notesMasterIdLst>
  <p:sldIdLst>
    <p:sldId id="772" r:id="rId3"/>
    <p:sldId id="1244" r:id="rId4"/>
  </p:sldIdLst>
  <p:sldSz cx="9144000" cy="6858000" type="screen4x3"/>
  <p:notesSz cx="6858000" cy="9296400"/>
  <p:defaultTextStyle>
    <a:defPPr>
      <a:defRPr lang="en-US"/>
    </a:defPPr>
    <a:lvl1pPr algn="l" rtl="0" fontAlgn="base">
      <a:spcBef>
        <a:spcPct val="0"/>
      </a:spcBef>
      <a:spcAft>
        <a:spcPct val="0"/>
      </a:spcAft>
      <a:defRPr kern="1200">
        <a:solidFill>
          <a:schemeClr val="tx1"/>
        </a:solidFill>
        <a:latin typeface="Arial" pitchFamily="34" charset="0"/>
        <a:ea typeface="MS Pゴシック" pitchFamily="34" charset="-128"/>
        <a:cs typeface="+mn-cs"/>
      </a:defRPr>
    </a:lvl1pPr>
  </p:defaultTextStyle>
</p:presentation>