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

Free Support Forum - aspose.com

Text and image on one line

Hi Aspose experts,

Can Aspose Slides create slides like this:

1. [Text] [Image] [Text]
2. [Text] [Image] [Text] [Image] [Image]
3…

I means I need to insert texts and images on one line of a paragraph or one line of texts and images. I know paragraph and portion only contain text.
Is there any solution for this?

Hi Vuong,

I like to share that at the moment the ImageHolder is not supported in PlaceHolder. At the moment only TextHolder is supported to use with PlaceHolder. An issue with ID 24422 has already been created in our issue tracking system as a new feature request to support images, charts and other shapes in PlaceHolder. This thread has also been linked with the same issue so that you may be automatically notified when the feature is available.

Aspose.Slides allows you to place shapes any where on the slide. So as a work around, you may place image shapes between desired text manually.

Thanks and Regards,

Thanks Mudassir,

- Those texts and images are dynamic, I iterate my data to insert texts and images like that. So, how we know width of a portion in order to calculate position for images.
Ex:
1. [Text] [Image]
where [Text] is a portion class => how calculate its width? => calculate position of [Image]?

Hi Vuong,

I like to share that Portions are part of Paragraph and Paragraphs are part of TextFrame. A TextFrame is actually associated with a shape to hold shape text. As a matter of fact the position property belongs to shape object. Now, if a shape has some text inside it that is of only one line and the entire line has same font related properties then the TextFrame is said to have one paragraph with only one portion. We can exploit this property for your use. In this case whenever you like to get the portion position, you will in fact refer to shape position that will actually be depiction of portion position. In this you may also need to set the shape properties of fitting shape to text or text to shape as well.

Now, the work around will go like this that you will add a shape at a given position and add text in it until the point where image has to be inserted. Now, you can get the shape X, Y, width heights and calculate the position where image is to be placed and add image there. Now, you get the X,Y, width and height of inserted image shape and calculate the position of the shape that will hold the remaining part of the text. I am aware that the approach is a bit calculate but its only workable solution that can be employed under current circumstances.

Thanks and Regards,

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


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