Hi,
I have a simple presentation with one portion containing hyperlink to web address. I’m changing the whole paragraph by adding three new portions with one of them containing new hyperlink and different display text. The problem I have is that the hyperlink value I set gets overwritten with the actual display text I apply. Please see the screenshot for your reference.
Here’s the code I use:
String path = “simple.ppt”;
Presentation presentation = new Presentation(path);
ISlide slide = presentation.getSlides().get_Item(0);
IAutoShape shape = (IAutoShape) slide.getShapes().get_Item(1);
IParagraph paragraph = shape.getTextFrame().getParagraphs().get_Item(0);
IPortionCollection portions = paragraph.getPortions();
portions.clear();
portions.add(new Portion(“Visit “));
IPortion portion = new Portion();
portions.add(portion);
portions.add(new Portion(”.”));
IHyperlink hyperlink = new Hyperlink(new Hyperlink(“http://www.kraljevo.com/”), null, “”, false, false, false);
portion.setText(“www.kraljevo.cöõm”);
portion.getPortionFormat().setHyperlinkClick(hyperlink);
presentation.save(“simple-16.12.0.ppt”, SaveFormat.Ppt);
I’m using Aspose.Slides for Java 16.12.0.
Can you check this?
Thanks,
Zeljko