Using Aspose slides for java 24.9. When I attempt to change url for one of the hyperlinks, text of that hyperlink gets changed as well.
Presentation presentation = new Presentation("/path/to/input/link_corruption2.pptx");
ISlide slide = presentation.getSlides().get_Item(0);
for (IHyperlinkContainer hyperlinkContainer : slide.getHyperlinkQueries().getHyperlinkClicks()) {
hyperlinkContainer.getHyperlinkManager().setExternalHyperlinkClick("https://some.new.url.com");
}
presentation.save("/path/to/input/link_corruption2_updated.pptx", SaveFormat.Pptx);
If I change target url to something that does not contain colon in it, the issue is not reproducible. E.g. “www.some.new-url.com” - will work fine.
link_corruption2.pptx.zip (210.1 KB)
@andyradchenko,
Thank you for describing the issue. I’ve reproduced the problem with the text when changing the hyperlink address. We are sorry that you have to encounter this problem.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESJAVA-39541
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@andyradchenko,
Our developers have investigated the case. Please try using the following workaround:
Presentation presentation = new Presentation("link_corruption2.pptx");
ISlide slide = presentation.getSlides().get_Item(0);
for (ITextFrame frame : SlideUtil.getAllTextBoxes(slide)) {
for (IParagraph paragraph : frame.getParagraphs()) {
for (IPortion portion : paragraph.getPortions()) {
if (portion.getPortionFormat().getHyperlinkClick() != null)
{
String text = portion.getText();
portion.getPortionFormat().setHyperlinkClick(new Hyperlink("https://some.new.url.com"));
portion.setText(text);
}
}
}
}
presentation.save("output.pptx", SaveFormat.Pptx);