Free Support Forum - aspose.com

Accessing portions by ID?

Hi there

I’m wondering is it possible to query portions by ID the way you can with slides and images. This would be very useful. If not, are there any plans to add this feature?

Thanks

Eric

Hello,

PowerPoint doesn’t create unique identifiers for portions and paragraphs. Why not access them by index instead?

Hi Alexey

I see. I suppose what I would like is a way to access portions without having to to parse the shapes and texframes which contain them first. It would be great if I could just say:

for (int i = 0; i < pptdoc.Slides.Count; i++)
{
Slide current = pptdoc.Slides[i];

/* get all the portions in the current slide */
for (int k = 0; k < current.Portions.Count; k++)
{
Portion p = current.Portions[k];
//do portion modification here…
}
}


The reason for this is that we are using Slides with our document translation software. The thing is, we only want to modify the text (and possibly images and a later stage), and leave the other objects in the document untouched.

Maybe there is similar functionality already, I’m not sure.

Thanks

Eric


I think you have to parse whole text anyway. Especially for translation purposes because one word can have several portions inside. For example word “Hello” has 5 portion because each character formatted in a different way.

Yes thats a good point Alexey. I suppose then would it be possible to query paragraphs by a unique ID or have this feature added?

Best,

Eric

In theory, we can add guid or something similar to each text paragraph. The only problem is I think paragraph search will be slow enough for large presentations with a lot of text.

Hi Alexey

That would be fantastic. We don’t need to do a search as such, we would just like to be able to iterate
through the paragraphs in a presentation in a linear fashion. The reason for this is that in our translation solutions for other file formats like Word and Adobe FrameMaker, we tried an approach whereby we would delete all the text and objects in those documents, before reconstructing them based on metadata we recorded during the initial file parsing. We found that this caused more problems than it solved so we’re hoping to go for a more minimal approach, modifying the text in situ rather than deleting and rewriting it.

Thanks

Eric

Hello Eric,

In this case, what you think if I offer you another possible solution? We can create Slide level (I prefer not a Presentation level) property or method which returns collection with all TextFrame or Paragraph objects on a slide. So you can iterate all of them and change if necessary.

Hi Alexey,

Yes that would certainly make life easier :slight_smile: It would mean then that we are not trying to parse every object in a document purely to obtain its textual content. If you intend to add this feature, do you know which release it would be added in?

Thanks

Eric

I think it will be available in the next release.

Wow! That’s customer service! :slight_smile:
Will this be the case for the PPTX API as well?

Thanks

Eric

Thank you.

Sure, it will be available for both file formats.

That’s fantastic news. Do you have any idea when the next release of Aspose.Slides will be?
Also, do you plan to merge the PPTX API into the PPT one, and if so, is there a timeline for this as well?
We’re building a PowerPoint solution for our software using Aspose.Slides, hoping to have it ready for early December.

Thanks

Eric

Next version will be available at the last weekends of this month. Api will be merged in the first quarter of the next year. Actually, we already started this work.

The issues you have found earlier (filed as 11049) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(10)

Hi There

Thanks for the notification. If I want to access all the textframes on a slide, is there a textframe array visible for each slide object?

Thanks

Eric

Hi Eric,

Aspose.Slides for .NET 4.0.1.0 introduces a number of overloaded static methods exposed by Aspose.Slides.Util.PresentationScanner to get all the TextFrames in a slide and presentation as well. For more information you can visit here. An example to get all TextFrames from a slide is here:

TextFrameEx[] tf = (TextFrameEx[])Aspose.Slides.Util.PresentationScanner.GetAllTextBoxes(pres.Slides[0]);