Adjusting text to textbox

HHi, it seems DocIO can adjust text size to fit into text box. However it seems it is available for PowerPoint only.
I need it badly for Word. Any chance?i, it seems DocIO can adjust text size to fit into text box. However it seems it is available for PowerPoint only. I need it badly for Word. Any chance?

3 Replies 1 reply marked as answer

MR Manikandan Ravichandran Syncfusion Team August 24, 2020 09:42 AM UTC

Hi Gyorgy,

Thank you for contacting Syncfusion support.

From the given details, we have found that, you requirement is to adjust the text to fit in the textbox in the Word document using DocIO. For this, we have suggest you to use the AutoFit property of the textbox as like below.

 
//Resize the textbox based on its contents
textbox.TextBoxFormat.AutoFit = true; 

Please let us know if you have any other questions.

Regards,
Manikandan Ravichandran
 



GG Gyorgy Gorog August 26, 2020 09:52 AM UTC

Manikandan, thanks for update.

I actually need the opposite: adjust font size and line spacing so that text fits into the textbox. Textbox size is fixed.

Thanks!


MR Manikandan Ravichandran Syncfusion Team August 27, 2020 09:17 AM UTC

Hi Gyorgy,

Thank you for your update.

For adjust the font size of the text range, kindly use the below code example.
 
textRange.CharacterFormat.FontSize = 12; 

Please refer the below UG link to know more on this
https://help.syncfusion.com/file-formats/docio/working-with-paragraph#working-with-text

For adjust the line spacing between the text, kindly use the below code example.
 
paragraph.ParagraphFormat.LineSpacing = 10f; 

Please refer the below UG link to know more on this.
https://help.syncfusion.com/file-formats/docio/working-with-paragraph#applying-paragraph-formatting

Please let us know if you have any further questions.

Regards,
Manikandan Ravichandran
 


Marked as answer
Loader.
Up arrow icon