How to calculate the size of a text frame with many portions?


Hi Guys,

I appreciate that auto resizing in not yet implemented. BTW, this is quite an important feature I’m sure for many users.

I’m happily constructing different paragraphs containing different font size, bold, italic, underline, colour, and styles. Each paragraph for example might have 6 lines in it, and 15 portions.

How can one calculate the height off one of these textframes? I’m currently doing something very primitive but it is not accurate and not good enough. (I’m just adding up the length of all the string length of each components, dividing it by the average amount of characters per line, add 1 to ensure rounding doesn’t give us 0 lines, and then multiplying by some twip constant). Or do i need to go into GDI calls and starts calculating height of fonts?

Alternatively (and the best solution) would be to have the auto size stuff to be implemented, but any assistance here would be appreciated.

Thanks for your help



Hi Cor,

I have similar problems, i solved it by using GDI (MeasureString). But thats not 100% exact too. GDI functions use other units of measurement.

I use paragraphs with one portion. That makes it a little bit easier. You have to consider that Paragraphs have TextOffset, SpaceWithin, SpaceBefore and SpaceAfter (something else?).



Hi Cor and Carsten,

It’s necessary to check and calculate everything: fonts, offsets, spaces and many other parameters.
Our code to render text on a slide is about 2000 lines now. Code for resizing will be comparable with it.
We are writing automatic frame resizing but it can take 3-4 weeks.
I’d suggest to wait it and don’t write own functions.


Hi Alexey,

Is there any description about the content of automatic frame resizing?
What do you mean with resizing? An implementation for the property “Resize shape to fit text”?
Or does it something like a pagination that splits the content of slides if it doesn t fit.



Yes, resize shape or table row to fit text.


Hi Alexie,

This functionality is really important to us, and we don't have the resources to code this ourselves, this Friday is last day of development for us.

Are you fairly confident you will deliver this functionality in September?


Do you calculate the size of shapes everytime i change text or fonts? Or only when i save my presentation.
I ask because i need the sizes of tables and textboxes in my code. I split slides if the content doesn fit. Therefor i need the sizes everytime i make changes to shapes.



Resize by developer’s request.
Separate function for recalculation so you can call when you need it.



I need the size before saving as well.

Will this functionaity still be delivered shortly?. We are at risk of having to delay our release.

Please let me know



Hello Alexey,

On the 2nd September you responded to this thread suggesting that this functionality is currently being written and may take 3 to 4 weeks.

We have developed our application utilising Apose.PowerPoint and this functionality is necessary before we can deploy it. Our application will be complete within the week.

Could you please confirm the date of when this functionality will be complete as it is a depency to our deployment date.

Thanks and regards,


We planned to finish it on the 1st of October but probably it will be delayed for one week.


Hello Alexey,

Do you have a release date now for this functionality? We are now waiting for this change so we can deploy our solution.

Thanks and regards



Dear Adam,

We are doing last tests and hot fix will be published tomorrow.


Thank you for delivering this change in Aspose.PowerPoint for .Net