-
Notifications
You must be signed in to change notification settings - Fork 5
Hyperlinks
shoaibkhan-aspose edited this page Aug 29, 2014
·
1 revision
// assign a hyperlink to a text run
XSLFTextBox shape = slide.createTextBox();
XSLFTextRun r = shape.addNewTextParagraph().addNewTextRun();
r.setText("Apache POI");
XSLFHyperlink link = r.createHyperlink();
link.setAddress("http://poi.apache.org");
// Add an AutoShape of Rectangle Type
IShape pptxShape = slide.getShapes().addAutoShape(ShapeType.Rectangle,
150, 150, 150, 50);
// Cast the shape to AutoShape
IAutoShape pptxAutoShape = (IAutoShape) pptxShape;
// Access ITextFrame associated with the AutoShape
pptxAutoShape.addTextFrame("");
ITextFrame ITextFrame = pptxAutoShape.getTextFrame();
// Add some text to the frame
ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0)
.setText("Aspose.Slides");
// Set Hyperlink for the portion text
IHyperlinkManager HypMan = ITextFrame.getParagraphs().get_Item(0)
.getPortions().get_Item(0).getPortionFormat()
.getHyperlinkManager();
HypMan.setExternalHyperlinkClick("http://www.aspose.com");
Download Source Code
For further releases and updates, please follow these new repositories:
- Aspose.Words Java for Apache POI
- Aspose.Cells Java for Apache POI
- Aspose.Slides Java for Apache POI
- Aspose.Email Java for Apache POI
- For documentation, please visit Aspose Docs.
- Raise your queries and suggest more examples via Aspose Forums or via new social coding sites.