Free Support Forum - aspose.com

Wrong links positions in PPT

Hi,

I noticed that links positions in text box does not match to positions from methods link.getBegin() and link.getEnd(). Is this a bug? I noticed this using following code.

public class PresentationPortinsTest {

public static void main(String[] args) throws Exception {
Presentation presentation = new Presentation(“d:/test/3679.ppt”);

Slide slide = presentation.getSlideByPosition(1);

Shapes shapes = slide.getShapes();

Shape shape = shapes.get(0);

TextFrame tf = shape.getTextFrame();

if (tf != null) {
String shapeText = tf.getText();

Portion portion = tf.getParagraphs().get(1).getPortions().get(1);

String portionText = portion.getText();
int portionTextLength = portionText.length();

int portionStart = shapeText.indexOf(portionText);
int portionEnd = portionStart + portionTextLength;

System.out.println(shapeText);

Links links = tf.getLinks();

Link link = links.get(0);

System.out.println(link.getExternalHyperlink());

System.out.println("Link start " + link.getBegin());

System.out.println("Link end " + link.getEnd());

System.out.println("Portion text " + portionText);

System.out.println("Portion text start " + portionStart);

System.out.println("Portion text end " + portionEnd);
}

}
}

3679.ppt is in attachment.

Thanks,

Zeljko

Hi Zeljko,

Thanks for your interest in Aspose.Slides.

In the light of information provided by you, issue has been found in the initial investigation. An issue with issue id 13552 has been created on our Issue Tracking System for detailed investigation. This thread has been linked with this issue so that you can be informed about the progress.

Best Regards

Hi,

Thanks for fast response. Is possible to this issue be fixed in next release?

Zeljko

Hi Zeljko,

Thanks for your interest in Aspose.Slides.

The issue as reported by you has been logged and is in the evaluation phase on the end of our development team. As soon as there is a progress on this issue, you will be updated in this thread.

Best Regards

Hi,

Is there any progress about this issue?

Thanks,

Zeljko

Hi Zeljko,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Our development team has observed the specified issue in detail and found that link coordinates are correct. They are independent from portions and paragraphs. In this particular case link also includes carriage return '\r' character. So there is no problem.

Thanks and Regards,

Hi,

Thanks for response, it helped me a lot.

Zeljko