Hi,
I’m using a slightly modified code I posted here to generate HTML of the attached presentations. In Aspose.Slides for Java 18.2, unexpected underscores have been fixed. But I have another problem with moved and cut off content. Please see the attached screenshots
Here’s the code:
private static final String ZERO_WIDTH_SPACE_CHARACTER = "\u200B";
private static final String URL = "http://example.com/";
public static void main(String[] args) throws Exception {
String filePath = args[0];
String targetPath = args[1];
Presentation presentation = new Presentation(filePath);
ISlideCollection slides = presentation.getSlides();
for (ISlide slide : slides) {
IShapeCollection shapes = slide.getShapes();
for (IShape shape : shapes) {
if (shape instanceof IAutoShape) {
IAutoShape autoShape = (IAutoShape) shape;
ITextFrame textFrame = autoShape.getTextFrame();
if (textFrame != null) {
IParagraphCollection paragraphs = textFrame.getParagraphs();
for (IParagraph paragraph : paragraphs) {
IPortionCollection portions = paragraph.getPortions();
List<IPortion> temporaryPortions = new ArrayList<>();
for (IPortion portion : portions) {
if (!portion.getText().trim().isEmpty()) {
temporaryPortions.add(createHyperlinkPortion());
temporaryPortions.add(portion);
temporaryPortions.add(createHyperlinkPortion());
}
}
portions.clear();
for (IPortion portion : temporaryPortions) {
portions.add(portion);
}
}
}
}
}
}
presentation.save(targetPath, SaveFormat.Html);
presentation.dispose();
}
private static IPortion createHyperlinkPortion() {
IPortion portion = new Portion(ZERO_WIDTH_SPACE_CHARACTER);
portion.getPortionFormat().setHyperlinkClick(new Hyperlink(URL));
return portion;
}
Can you check this?
Thanks,
Zeljko
Immunology_panels_launch_presentation.PNG (301.7 KB)
NavisphereManagementSuite.PNG (190.6 KB)
Immunology_panels_launch_presentation.ppt.zip (779.6 KB)
NavisphereManagementSuite.ppt.zip (1.9 MB)