此文件包含用于程序化PowerPoint编辑的XML模式。在直接处理OOXML格式时使用这些模式。
注意: 示例中的颜色值(例如
E67E22、D35400)是占位符。替换为模板的品牌色。
在以下情况下使用 python-pptx:
仅在以下情况下使用直接XML编辑:
绝对不要使用直接XML进行:
此文件中的XML模式用于参考和针对性修改,而非整体元素构建。
直接XML编辑如果不谨慎操作可能损坏PowerPoint文件:
始终在处理副本上操作——绝不要直接编辑原始文件。
创建任何表格后,必须验证它是实际表格对象,而非带分隔符的文本。
程序化验证(python-pptx):
for shape in slide.shapes:
if shape.has_table:
print(f"✓ 找到表格:{len(shape.table.rows)}行, {len(shape.table.columns)}列")视觉验证(在导出的图像中):
失败指标——您创建的是文本,而非表格:
|字符\t)进行间距基于文本的"表格"接收方无法编辑,字体变化时会对不齐,并且显示业余水平。在推介演示文稿中,绝不允许使用管道符/制表符分隔的表格数据。
<a:tbl>
<a:tblPr firstRow="1" bandRow="1">
<a:tableStyleId>{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}</a:tableStyleId>
</a:tblPr>
<a:tblGrid>
<a:gridCol w="2000000"/> <!-- 来源列 - 宽度以EMU为单位 -->
<a:gridCol w="1200000"/> <!-- 2024规模列 -->
<a:gridCol w="1200000"/> <!-- CAGR列 -->
<a:gridCol w="1200000"/> <!-- 2030预测列 -->
</a:tblGrid>
<!-- 以下是行定义 -->
</a:tbl><a:tr h="370840"> <!-- 行高以EMU为单位 -->
<a:tc>
<a:txBody>
<a:bodyPr/>
<a:lstStyle/>
<a:p>
<a:pPr algn="l"/> <!-- 文本列左对齐 -->
<a:r>
<a:rPr lang="en-US" sz="1000" b="0"/>
<a:t>Grand View Research</a:t>
</a:r>
</a:p>
</a:txBody>
<a:tcPr/>
</a:tc>
<a:tc>
<a:txBody>
<a:bodyPr/>
<a:lstStyle/>
<a:p>
<a:pPr algn="ctr"/> <!-- 数字列居中对齐 -->
<a:r>
<a:rPr lang="en-US" sz="1000"/>
<a:t>22.1</a:t>
</a:r>
</a:p>
</a:txBody>
<a:tcPr/>
</a:tc>
<!-- 更多单元格... -->
</a:tr><a:tr h="370840">
<a:tc>
<a:txBody>
<a:bodyPr/>
<a:lstStyle/>
<a:p>
<a:pPr algn="l"/>
<a:r>
<a:rPr lang="en-US" sz="1000" b="1"> <!-- 标题加粗 -->
<a:solidFill>
<a:srgbClr val="FFFFFF"/> <!-- 白色文本 -->
</a:solidFill>
</a:rPr>
<a:t>来源</a:t>
</a:r>
</a:p>
</a:txBody>
<a:tcPr>
<a:solidFill>
<a:srgbClr val="E67E22"/> <!-- 橙色背景 -->
</a:solidFill>
</a:tcPr>
</a:tc>
<!-- 更多标题单元格... -->
</a:tr><p:sp>
<p:nvSpPr>
<p:cNvPr id="10" name="Arrow Right"/>
<p:cNvSpPr/>
<p:nvPr/>
</p:nvSpPr>
<p:spPr>
<a:xfrm>
<a:off x="3000000" y="2500000"/> <!-- 以EMU为单位的位置 -->
<a:ext cx="500000" cy="300000"/> <!-- 以EMU为单位的尺寸 -->
</a:xfrm>
<a:prstGeom prst="rightArrow">
<a:avLst/>
</a:prstGeom>
<a:solidFill>
<a:srgbClr val="E67E22"/> <!-- 箭头填充色 -->
</a:solidFill>
<a:ln>
<a:noFill/> <!-- 无轮廓 -->
</a:ln>
</p:spPr>
</p:sp><p:sp>
<p:nvSpPr>
<p:cNvPr id="11" name="Arrow Down"/>
<p:cNvSpPr/>
<p:nvPr/>
</p:nvSpPr>
<p:spPr>
<a:xfrm>
<a:off x="2500000" y="3000000"/>
<a:ext cx="300000" cy="500000"/>
</a:xfrm>
<a:prstGeom prst="downArrow">
<a:avLst/>
</a:prstGeom>
<a:solidFill>
<a:srgbClr val="E67E22"/>
</a:solidFill>
</p:spPr>
</p:sp><p:sp>
<p:nvSpPr>
<p:cNvPr id="12" name="Chevron"/>
<p:cNvSpPr/>
<p:nvPr/>
</p:nvSpPr>
<p:spPr>
<a:xfrm>
<a:off x="3000000" y="2500000"/>
<a:ext cx="400000" cy="600000"/>
</a:xfrm>
<a:prstGeom prst="chevron">
<a:avLst/>
</a:prstGeom>
<a:solidFill>
<a:srgbClr val="E67E22"/>
</a:solidFill>
</p:spPr>
</p:sp><p:sp>
<p:nvSpPr>
<p:cNvPr id="5" name="TextBox 4"/>
<p:cNvSpPr txBox="1"/>
<p:nvPr/>
</p:nvSpPr>
<p:spPr>
<a:xfrm>
<a:off x="500000" y="1500000"/>
<a:ext cx="4000000" cy="500000"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
<a:noFill/>
</p:spPr>
<p:txBody>
<a:bodyPr wrap="square" rtlCol="0">
<a:spAutoFit/>
</a:bodyPr>
<a:lstStyle/>
<a:p>
<a:r>
<a:rPr lang="en-US" sz="1400" dirty="0"/>
<a:t>在此输入文本内容</a:t>
</a:r>
</a:p>
</p:txBody>
</p:sp><p:txBody>
<a:bodyPr wrap="square">
<a:spAutoFit/>
</a:bodyPr>
<a:lstStyle/>
<a:p>
<a:pPr marL="342900" indent="-342900">
<a:buFont typeface="Wingdings" panose="05000000000000000000" pitchFamily="2" charset="2"/>
<a:buChar char="ü"/> <!-- 对勾符号字符 -->
</a:pPr>
<a:r>
<a:rPr lang="en-US" sz="1400" dirty="0"/>
<a:t>第一个要点</a:t>
</a:r>
</a:p>
<a:p>
<a:pPr marL="342900" indent="-342900">
<a:buFont typeface="Wingdings" panose="05000000000000000000" pitchFamily="2" charset="2"/>
<a:buChar char="ü"/>
</a:pPr>
<a:r>
<a:rPr lang="en-US" sz="1400" dirty="0"/>
<a:t>第二个要点</a:t>
</a:r>
</a:p>
</p:txBody><a:r>
<a:rPr lang="en-US" sz="1000" b="1" i="1" dirty="0">
<a:solidFill>
<a:srgbClr val="FFFFFF"/> <!-- 白色文本 -->
</a:solidFill>
</a:rPr>
<a:t>彩色背景上的白色文本</a:t>
</a:r><p:sp>
<p:nvSpPr>
<p:cNvPr id="20" name="Rectangle 19"/>
<p:cNvSpPr/>
<p:nvPr/>
</p:nvSpPr>
<p:spPr>
<a:xfrm>
<a:off x="500000" y="2500000"/>
<a:ext cx="1000000" cy="2000000"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
<a:solidFill>
<a:srgbClr val="E67E22"/> <!-- 橙色填充 -->
</a:solidFill>
<a:ln w="12700"> <!-- 边框宽度 -->
<a:solidFill>
<a:srgbClr val="D35400"/> <!-- 较深边框色 -->
</a:solidFill>
</a:ln>
</p:spPr>
<p:txBody>
<a:bodyPr rtlCol="0" anchor="ctr"/> <!-- 垂直居中文本 -->
<a:lstStyle/>
<a:p>
<a:pPr algn="ctr"/> <!-- 水平居中 -->
<a:r>
<a:rPr lang="en-US" sz="1600" b="1">
<a:solidFill>
<a:srgbClr val="FFFFFF"/>
</a:solidFill>
</a:rPr>
<a:t>标签文本</a:t>
</a:r>
</a:p>
</p:txBody>
</p:sp><p:pic>
<p:nvPicPr>
<p:cNvPr id="99" name="Company Logo"/>
<p:cNvPicPr>
<a:picLocks noChangeAspect="1"/>
</p:cNvPicPr>
<p:nvPr/>
</p:nvPicPr>
<p:blipFill>
<a:blip r:embed="rIdLogo"/> <!-- 引用关系ID -->
<a:stretch>
<a:fillRect/>
</a:stretch>
</p:blipFill>
<p:spPr>
<a:xfrm>
<a:off x="10800000" y="200000"/> <!-- 右上角位置 -->
<a:ext cx="800000" cy="600000"/> <!-- 标志尺寸 -->
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
</p:spPr>
</p:pic>在 ppt/slides/_rels/slideN.xml.rels 中:
<Relationship Id="rIdLogo"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
Target="../media/logo.png"/><p:cxnSp>
<p:nvCxnSpPr>
<p:cNvPr id="15" name="Straight Connector 14"/>
<p:cNvCxnSpPr>
<a:cxnSpLocks/>
</p:cNvCxnSpPr>
<p:nvPr/>
</p:nvCxnSpPr>
<p:spPr>
<a:xfrm>
<a:off x="500000" y="2500000"/>
<a:ext cx="5000000" cy="0"/> <!-- 水平线 -->
</a:xfrm>
<a:prstGeom prst="line">
<a:avLst/>
</a:prstGeom>
<a:ln w="12700">
<a:solidFill>
<a:srgbClr val="E67E22"/>
</a:solidFill>
</a:ln>
</p:spPr>
</p:cxnSp><p:spPr>
<a:xfrm>
<a:off x="500000" y="4500000"/>
<a:ext cx="5000000" cy="0"/>
</a:xfrm>
<a:prstGeom prst="line">
<a:avLst/>
</a:prstGeom>
<a:ln w="12700">
<a:solidFill>
<a:srgbClr val="E67E22"/>
</a:solidFill>
<a:prstDash val="dash"/> <!-- 虚线样式 -->
</a:ln>
</p:spPr>| 单位 | 每单位的EMU |
|---|---|
| 1英寸 | 914400 |
| 1厘米 | 360000 |
| 1磅 | 12700 |
| 1像素(96 DPI) | 9525 |
| 元素 | X位置 | Y位置 |
|---|---|---|
| 标志(右上角) | 10800000 | 200000 |
| 标题 | 342583 | 286603 |
| 副标题 | 402591 | 1767390 |
| 页脚 | 342583 | 6435334 |