简体   繁体   中英

how to insert slide's background into powerpoint using xml

How can I insert background of pptx slides into the presentation by editing its xml ? This document show how to apply a theme to the presentation: https://docs.microsoft.com/en-us/office/open-xml/how-to-apply-a-theme-to-a-presentation#structure-of-the-theme-element But it doesn't show how to insert background to a slide. Which part of the xml contains the information about backgrounds ?

Background elements are found in slideMaster1.xml and in each slide layout and slide. You can set the background on any of these. In OOXML, the order of XML elements is also the stacking order, so the background is the first section of the XML:

<p:cSld>
  <p:bg>
    <p:bgPr>
      <a:solidFill>
        <a:schemeClr val="bg1"/>
      </a:solidFill>
      <a:effectLst/>
    </p:bgPr>
  </p:bg>

The above shows the standard blank white background of a new blank presentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM