【问题标题】:Powerpoint Super Theme, Manually building the .thmx file and editing the xml filesPowerpoint Super Theme,手动构建 .thmx 文件并编辑 xml 文件
【发布时间】:2020-11-23 22:21:16
【问题描述】:

我目前正在通过手动组合多个.thmx 文件来构建自己的 PowerPoint 超级主题文件。

要让这个xml工作,需要手动编辑,我已经掌握了它的窍门,除了id/vid属性的UID。

因为我不是真正的程序员,所以请多多尝试……

在每个 theme1.xml 文件的末尾都有一个 UID-id 属性。我假设这代表超级主题的id,因为对于超级主题中的所有主题文件,id 需要相同。

我尝试从我从 PowerPoint 保存的主题文件中重用 id,但这不起作用,我假设这在某些方面被识别为单个主题文件。我还尝试从现有的超级主题文件中借用 UID,除非该主题文件已在我的系统上使用,否则该文件有效。

以类似的方式有一个vid 属性,它表示超级主题的变体,位于theme1.xml 中的id 旁边,并且在列出所有变体的themeVariantManager.xml 中超级主题。我再次尝试使用从 PowerPoint 保存的文件中的vid,但这不起作用。但如果我从另一个超级主题文件中借用vid 的格式,我就能让它工作。

所以我真的很想知道如何为我的idvid 生成一个UID,以便我可以根据需要创建它们。

idvid 在 theme1.xml 中的使用示例

<a:extLst>
    <a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}">
        <thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="MM Petrol" id="{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}" vid="{EC7F02AD-9687-440F-A9DF-FAA6F22270D7}"/>
    </a:ext>
</a:extLst>

在 themeVariantManager.xml 中如何使用 vid 的示例

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<t:themeVariantManager xmlns:t="http://schemas.microsoft.com/office/thememl/2012/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
  <t:themeVariantLst>
    <t:themeVariant name="Grey" vid="{B8502691-933B-45FE-8764-BA278511EF27}" cx="12192000" cy="6858000" r:id="rId1" />
    <t:themeVariant name="Petrol" vid="{EC7F02AD-9687-440F-A9DF-FAA6F22270D7}" cx="12192000" cy="6858000" r:id="rId2" />
    <t:themeVariant name="Grey" vid="{B8502691-933B-45FE-8764-BA278511EF27}" cx="9144000" cy="6858000" r:id="rId3" />
    <t:themeVariant name="Petrol" vid="{EC7F02AD-9687-440F-A9DF-FAA6F22270D7}" cx="9144000" cy="6858000" r:id="rId4" />
  </t:themeVariantLst>
</t:themeVariantManager>

我尝试搜索有关该主题的帮助,但我不走运。 我发现这个只带我到目前为止...... Editing Super Themes with XML

提前谢谢...

雅各布

【问题讨论】:

  • 任何有效的 GUID 都可以使用。谷歌 GUID Generator 可以找到一些免费的在线工具。

标签: xml themes powerpoint uid


【解决方案1】:

与往常一样,一旦您发布了您的答案... 我将获取 UID 的 .thmx 文件保存在同一目录中。然后让 2 个使用相同 UID 的 .thmx 文件破坏了 UID 的想法,因此 powerpoint 对引用的文件感到困惑并选择了错误的文件。

执行与我第一次尝试相同的例程,但从主题目录中删除原始 .thmx 文件解决了我的问题。

【讨论】:

    【解决方案2】:

    我假设你已经弄清楚了,但是 id 只是随机标识符,只要它们在超级主题文件中是一致的并且不等于另一个 thmx 文件中的另一个 id,它应该可以工作。一些可以帮助您的注意事项:

    • 超级主题在主题文件夹中包含基本主题(用于向后兼容),其余主题在 themeVariants 文件夹中。
    • 每个超级主题都有一个主题系列ID,并将其保存到pptx文档中,以便应用程序可以从主题库中选择正确的主题并在打开此类pptx时填充主题变体。每个主题变体必须相同。
    • 每个变体组都有一个变体 ID,用于在主题变体库中显示不同的变体。如果您希望每个变体支持多种尺寸,您可以将相同的变体 id 分配给不同尺寸的主题,并且将自动在该组中选择与源最接近的匹配,并且它只会在变体库中显示一次

    在您的示例代码中,我可以看到 Grey 变体具有不同的大小,但指向相同的关系 id rId1,这将是一个问题(类似于 Petrol

    所以,一些常见的建议,

    • 让每个主题都有一个您生成的唯一主题系列 ID。
    • 拥有每个主题组(一组可能具有相似功能但支持多种尺寸的主题,例如 16:9 尺寸的主题变体,而另一个 varint 可能支持 4:3 幻灯片尺寸),具有相同的唯一性您生成的主题变体 ID。
    • 从基本(默认)主题开始(以便默认主题文件位于\theme 文件夹中)
    • 将所有其他主题添加到themeVariants\variantX 文件夹中(variant1、variant2 等)。
    • 按照您的准备创建/编辑themeVariantManager.xml,列出您添加的所有thmx 文件。使用您为每个组定义的相同主题变体 ID。
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <t:themeVariantManager xmlns:t="http://schemas.microsoft.com/office/thememl/2012/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
        <t:themeVariantLst>
            <t:themeVariant name="Ion" vid="{292E63A9-BB86-4E3D-B92A-7223C6510D2E}" cx="12192000" cy="6858000" r:id="rId1" />
            <t:themeVariant name="Ion" vid="{BACC050B-8757-4460-95D8-E37B46A6B421}" cx="12192000" cy="6858000" r:id="rId2" />
            <t:themeVariant name="Ion" vid="{A207AED3-9ABC-4A18-9978-A59B65688B15}" cx="12192000" cy="6858000" r:id="rId3" />
            <t:themeVariant name="Ion" vid="{5A2F9111-B2DB-470C-BA56-608F9B658826}" cx="12192000" cy="6858000" r:id="rId4" />
            <t:themeVariant name="Ion" vid="{292E63A9-BB86-4E3D-B92A-7223C6510D2E}" cx="9144000" cy="6858000" r:id="rId5" />
            <t:themeVariant name="Ion" vid="{BACC050B-8757-4460-95D8-E37B46A6B421}" cx="9144000" cy="6858000" r:id="rId6" />
            <t:themeVariant name="Ion" vid="{A207AED3-9ABC-4A18-9978-A59B65688B15}" cx="9144000" cy="6858000" r:id="rId7" />
            <t:themeVariant name="Ion" vid="{5A2F9111-B2DB-470C-BA56-608F9B658826}" cx="9144000" cy="6858000" r:id="rId8" />
        </t:themeVariantLst>
    </t:themeVariantManager>
    
    • 创建/编辑 themeVariantManager.xml.rels 文件,其中包含每个变体的路径以及您定义的关系 ID。
    <?xml version="1.0" encoding="utf-8"?>
    <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/theme/theme/themeManager.xml" Id="rId1" />
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/themeVariants/variant1/theme/theme/themeManager.xml" Id="rId2" />
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/themeVariants/variant2/theme/theme/themeManager.xml" Id="rId3" />
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/themeVariants/variant3/theme/theme/themeManager.xml" Id="rId4" />
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/themeVariants/variant4/theme/theme/themeManager.xml" Id="rId5" />
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/themeVariants/variant5/theme/theme/themeManager.xml" Id="rId6" />
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/themeVariants/variant6/theme/theme/themeManager.xml" Id="rId7" />
        <Relationship Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="/themeVariants/variant7/theme/theme/themeManager.xml" Id="rId8" />
    </Relationships>
    

    (看看这两个文件中定义的rid。如果有什么不清楚的地方请告诉我。)

    【讨论】:

    • 谢谢,我后来注意到错误的行 ID。我现在对它们进行了编辑,因此如果有人会查看它以供参考,它们会显示正确。
    【解决方案3】:

    如果我理解正确的话,考虑到这些自 2013 年以来就已经存在,我很惊讶关于这些的信息如此之少。

    也许您或其他人可以分享一些建议,无论是使用 SuperTheme (.tmx) 还是模板 (.potx) 作为公司设置,赞成和反对之类的。

    据我所知,主题只能存储布局、颜色和格式默认值,但可以选择多个,您可以轻松地在它们之间切换。模板可以包括一个或多个幻灯片母版,每个都有不同的颜色,但不是每个都可以切换。但是,模板可以包含许多预制幻灯片。

    但我不认为这些可以组合,即模板可以使用主题。然后,您需要创建一个常规幻灯片 (.pptx) 并以此为基础工作。

    【讨论】:

    • 这里的重点是正确的,模板包括主题+一些幻灯片。主题不包含幻灯片。超级主题包含多个主题,但它们不会保存到 pptx 文件中。因此,要利用超级主题,您需要将超级主题安装/复制到将要使用的机器上的自定义主题文件夹中。您可以拥有一个使用超级主题变体的模板,假设超级主题已安装/添加到该计算机。共享 pptx 文件时,只会共享主题的应用/选定变体,而不是超级主题。我希望这会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-20
    • 1970-01-01
    • 2010-12-27
    • 2019-03-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多