Skip to main content

notes_xml

Function notes_xml 

Source
pub fn notes_xml(tb: &TextBody) -> String
Expand description

写一段备注页 XML(<p:notes>)。

备注页与 slide 结构类似,但内部只有一个 placeholder(type="body") 承载 TextBody。OOXML 规范要求 placeholder id 显式标注(常用 idx="1")。

§与 python-pptx 的对应

python-pptx 中 slide.notes_slide.notes_text_frame.text = "..." 最终会 序列化为本函数产出的格式。

§元素顺序(OOXML 规范)

<p:notes>
  <p:cSld>
    <p:spTree>
      <p:nvGrpSpPr/>
      <p:grpSpPr/>
      <p:sp>           ← placeholder body
        <p:nvSpPr>
          <p:cNvPr id="2" name="Notes Placeholder"/>
          <p:cNvSpPr txBox="1"/>
          <p:nvPr><p:ph type="body" idx="1"/></p:nvPr>
        </p:nvSpPr>
        <p:spPr><a:xfrm/><a:prstGeom prst="rect"/></p:spPr>
        <p:txBody>...   ← TextBody 内容
      </p:sp>
    </p:spTree>
  </p:cSld>
  <p:clrMapOvr bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2"/>
</p:notes>