We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Wrong Paragraph TextOffset

Hello,

I would like to handle correctly hyperlinks in Presentation container. Each TextFrame offers a list of all links, but the problem is that the list belongs to a collection of following Paragraphs.

I have a problem that Paragraph.TextOffset gives me a wrong value. Please see an example and advise me how to correctly calculate offset?

I have to say that representation of Links in PresentationEx is much better!

Hi Martin,


Thanks for sharing the project code. I have worked with the sample and have tried to understand the issue. I have not been able to identify the issue. I will really appreciate, if you may please share that what issue you actually have observed and what it should be in your opinion. This way I will try to help you out further.

Many Thanks,

Hello,

I’ve posted an updated version. Please see Link #5 with offset 103-112,

TEXT: It is a gas giant with mass one-thousandt…

Described text run is in the second paragraph that has TextOffset == 216 and my question is how to find Link #5 according to TextOffset?

Thanks,
Martin

Hi Martin,


I have tried to understand your requirement and have worked over that. As in case of PPTX, the links are identified on portion level but in case of PPT the links are present as collection on TextFrame level. But you need to access the respective portion of text that has been hyper linked. If this is your requirement then I have modified the code snippet shared by you and it is serving the purpose. It is giving the behaviour similar to the one available in case of PPTX. I am hopeful it will serve the purpose for you.

Also, you have mentioned TextOffset property usage. This property actually sets the distance between bullet character and text of paragraph. It cannot be used in the current implementation for your usage.

Many Thanks,

Hello,

the modification you sent me works very good :wink: I have realized how to read Links in a proper way. But I have noticed maybe connected problem. When I tried to read a presentation from which I’ve sent you just first page, I was unable to detect any paragraph?

Could you please take a look at attached PPT file?

Thanks,
Martin

Hi Martin,


I have observed the issue in the new presentation shared. Actually, the text is either stored in TextFrame of shape or TextHolder of placeholder. In your new presentation _Jupiter.ppt there are TextHolders and respective TextFrames in that case are empty. I have modified the logic of your code and its working fine now. I have observed some issue in presentation that It was giving only one portion per paragraph even if there were many hyperlink in same paragraph. Theoretically, the portion changes whenever there is change in textual property of the paragraph. I just opened the presentation and saved it again in PowerPoint and it got fixed. Please also visit this documentation link for your further kind reference.

Many Thanks,

Hello,

you are right, there was just that problem with portions which were not splitted according to hyperlinks. Resaving helped me as well.

Thanks