Free Support Forum - aspose.com

Newline to textbox

Hi
If we have \n in the text does it automatically go to next line?

if i do the below

IAutoShape shape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 0, 0, 100, 100);
shape.addTextFrame(“Going to \n new line”);

the resulting textbox doesn’t have “\n” in it, instead the text is moved to next line? Initially I thought i saw \n so i manually implemented a way to convert all \n to new paragraphs but now i see that having \n in text results in new line automatically.

@wishy.em,

I have observed the requirements shared by you and like to share that multi line text can be added in a text frame by adding multiple paragraph. Every, new line is to be added using a paragraph. I suggest you to please visit this documentation link to serve purpose on your end.

Yes i know how to add multi line and like i stated I had implemented it but now I observe that just by adding \n to the text, the text is moving to next line.

@wishy.em,

It’s good to know that things have started to work on your end. Please share, if we may help you further in this regard.

Yes I would like to know.
Does’s adding \n to text automatically move the text to new line? Is this as intended by Aspose team?

@wishy.em,

I like to share that adding \n will move the text to new line but it will not add new paragraph. The new paragraph has to be added using documentation link shared by me.

Gotcha. Thank you