Creating TextBox with Hyperlink in Python

Creating TextBox with Hyperlink using Aspose.Slides Java for Python. Here you can see example code.

Python Code

 pres = self.Presentation()

\# Get the first slide

sld = pres.getSlides().get_Item(0)

\# Add autoshape of rectangle type

shapeType = self.ShapeType

pptxShape = sld.getShapes().addAutoShape(shapeType.Rectangle, 150, 150, 150, 50)

\# Cast the shape to AutoShape

pptxAutoShape = pptxShape

\# Access ITextFrame associated with the AutoShape


text_frame = pptxAutoShape.getTextFrame()

\# Add some text to the frame


#Set Hyperlink for the portion text

hypman = text_frame.getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getHyperlinkManager()


\# Write the presentation as a PPTX file

save_format = self.SaveFormat + "hLinkPPTX.pptx", save_format.Pptx)

print "Created TextBox with Hyperlink, please check the output file."

Download Running Code

Download running code from any of the below mentioned social coding sites: