Jump to content
We've recently updated our Privacy Statement, available here. ×

Export to PPT Script Not working

Prakash Kolekar 2

Recommended Posts

Hi, I am using below script to export visualization into PPT. it is works fine in client but not in web player. It does not giving any error, for couple of seconds showing processing.

Appreciate your help on this.

Below is the script

from System.IO import *

from Spotfire.Dxp.Application.Visuals import VisualContent

from System.Drawing import Bitmap, Graphics, Rectangle, Point

import clr


import Microsoft.Office.Interop.PowerPoint as PowerPoint


powerpoint = PowerPoint.ApplicationClass()

powerpoint.Visible = True


slideCounter = 1


for visual in Document.ActivePageReference.Visuals:

#print visual.Title


#export graphic to temp file

vc = visual.As[VisualContent]()

bm = Bitmap(2000, 1200)

g = Graphics.FromImage(bm)

r = Rectangle(Point(0,0), bm.Size)

vc.Render(g, r)

file = Path.GetTempFileName()



#pp setup

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

slideCounter = slideCounter+1

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






Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...