I am trying to update an existing document, adding text and graphs etc. However the text added can sometimes be quite long and overflow the page. so I need to loop through all slides and set the textboxes to be ‘autofit’
Howevere I’m unsure how to select only the textboxes
foreach (var drawing in slide.Content.Drawings)
{
if (drawing is GemBox.Presentation.Shape shape)
{
if (shape.Text != null && !string.IsNullOrEmpty(shape.Text.ToString()) && shape.Text.ToString().Length > 0)
{
//doesn't work as its a shape not a textbox
//shape.Format.AutoFit = GemBox.Presentation.TextAutoFit.ShrinkTextOnOverflow;
shape.FormatDrawing();
}
}
}
I am assuming its something like this but I can’t find the corrent syntax to find only textboxes.
I have attached a copy of the slide, as you can see it reduces the text to a size so small its unreadable even though it has plenty of whitespace underneath to expand into.
If I go to the settings in powerpoint and select the ‘shrink text to fit’ option it redues it enough to fit but its still readable.
I’m currently using version 25.0.1420, I tried upgrading but my key is no longer valid, I assume to use the latest version I would need to purchase a new key? or is it possible to get a trial key to see if it fixes the issue.
Tested it with the lates version and it does seem to have fixed it, would it be possible to get a 30 day trial key so I can test it with out the trial text changes?