[Modified] break character KO - Tabulation OK



I just Update my version of Aspose.PowerPoint and I found now a bug:

I try to insert a tabulation into a Portion an I get an error:

myParagraphs[ y ].Portions[ x ].Text = "\tTitle";

Can't assign string which contains paragraph break character

How can I keep my \t ???
Thanks for your answer


That is not possible.

Such exception can be thrown only if “\n” or “\r” found in the string.


But It was perfect with the version 2.3.5
Angry [:@] Now I cannot generate document from the users data.

Ok it great to have write for texteframe.text but it was perfectly working before.

Could you provide me more information and other way to obtain same result as before because I must downgrade my Aspose.PowerPoint version Crying [:'(]

Thanks for help



I just made some more tests with ASPOSE.PowerPoint v3.5.7.0

1/ About "\t"
In fact "\t" works, I have done more test and when I try to insert a "\t" into a portion, it works.
pres.Slides[0].Shapes[0].TextFrame.Paragraphs[0].Portions[0].Text = "# \t # \t #"; > OK

2/ About "\r" & "\n" & "\r\n"
Was perfectly working with ASPOSE.PowerPoint v2.3.5
pres.Slides[0].Shapes[0].TextFrame.Paragraphs[0].Portions[0].Text = "# \n #"; > KO

In debug or Release it provides an exception.
It's meaning that for each time I have a "\r\n" I need to insert a new paragraphs, hard work.
aspose.PowerPoint cannot do it itself ???

3/ Could you told me HOW I can insert a new line without a new paragraph ? You know like "SHIFT + ENTER" used in powerpoint document ????


Hello Mach!

You can insert soft line break using ‘\v’ character.


Please check this thread, it contains attached code at the end


We don’t provide automatic inserting string with carriage returns for better flexibility.

You can find my explanations why we disabled it in 2.3.6 in this forum.

Simple string parsing will take not more than 10 lines of code.

string sometext = “#\n#”;

Paragraphs paras = pres.Slides[0].Shapes[0].TextFrame.Paragraphs;

char[] delimiters = new char[] {’\r’, ‘\n’};

string[] split = sometext.Split(delimiters);

paras[0].Portions[0].Text = split[0];

for (int i = 1; i < split.Length; i++) {

paras.Insert(i, new Paragraph(paras[i - 1]));

paras[ i ].Portions.Clear();

paras[ i ].Portions.Add(new Portion(paras[0].Portions[0]));

paras[ i ].Portions[0].Text = split[ i ];


Hard work. Isn’t it?


Sure, it's not a Hard Work,
But in my case the generation core isn't as easy, and it's not a easy work to adapt it.

Doesn't matter. I will try to match "\r\n" with "\v"