You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将Spotfire可视化内容导出至预制公司PowerPoint模板指定位置?

Spotfire可视化导出至指定PowerPoint模板问题

我需要将Spotfire中的可视化内容导出至公司预制的PowerPoint模板中,且特定可视化内容需放置在模板的指定位置。我尝试过按照TIBCO社区相关文章操作,但未成功。目前我有一段代码可创建新PowerPoint并导出所有页面的可视化内容,代码如下:

import clr

clr.AddReference("System.IO")

from System.IO import *
from Spotfire.Dxp.Application.Visuals import *
from System.Drawing import Bitmap, Graphics, Rectangle, Point, Size
clr.AddReference("Microsoft.Office.Interop.PowerPoint")
import Microsoft.Office.Interop.PowerPoint as PowerPoint

powerpoint = PowerPoint.ApplicationClass()
powerpoint.Visible = True
pres = powerpoint.Presentations.Add()
slideCounter = 1

for page in Document.Pages:
    for visual in page.Visuals:
        vc = visual.As[VisualContent]()
        bm = Bitmap(800, 600)
        g = Graphics.FromImage(bm)
        r = Rectangle(Point(0, 0), bm.Size)
        vc.Render(g, r)
        file = Path.GetTempFileName()
        bm.Save(file)

        slide = pres.Slides.Add(slideCounter, PowerPoint.PpSlideLayout.ppLayoutTitleOnly)
        slideCounter += 1

        slide.Shapes.AddPicture(file, False, True, 30, 60, 650, 400)

        title = slide.Shapes.Title
        txt = slide.Shapes.AddTextBox(1, 10, 500, 500, 100)
        title.Top = 0.1
        obj = slide.Shapes.Title.TextFrame.TextRange
        obj.Font.Size = 24

请问有人能解决我的问题吗?是否有人成功按照上述文章操作实现需求?

内容的提问来源于stack exchange,提问作者Mattia Sferrazza

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 11:01:01