Hi,
I have .pptx and .ppt versions of the presentation with just one paragraph which contains hyperlinked text with tooltip. In .pptx file, I'm able to get the tooltip text, but in .ppt file I'm getting null.
Here's the code I use:
@Test
public void testPpt() throws Exception {
String presentationPath = "HyperlinksExternalTest.ppt";
InputStream inputStream = new FileInputStream(presentationPath);
Presentation presentation = new Presentation(inputStream);
inputStream.close();
ISlide slide = presentation.getSlides().get_Item(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get_Item(0);
IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(0);
IPortion portion = paragraph.getPortions().get_Item(0);
System.out.println("PPT");
System.out.println(portion.getText());
IHyperlink hyperlink = portion.createPortionFormatEffective().getHyperlinkClick();
System.out.println(hyperlink.getTooltip());
}
@Test
public void testPptx() throws Exception {
String presentationPath = "HyperlinksExternalTest.pptx";
InputStream inputStream = new FileInputStream(presentationPath);
Presentation presentation = new Presentation(inputStream);
inputStream.close();
ISlide slide = presentation.getSlides().get_Item(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get_Item(0);
IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(0);
IPortion portion = paragraph.getPortions().get_Item(0);
System.out.println("PPTX");
System.out.println(portion.getText());
IHyperlink hyperlink = portion.createPortionFormatEffective().getHyperlinkClick();
System.out.println(hyperlink.getTooltip());
}
Here's the output:
PPT
Hyperlink.
null
PPTX
Hyperlink.
Hyperlink. tooltip
I'm using Aspose.Slides for Java 16.9.0.
Can you check this?
Thanks,
Zeljko
Zeljko