Does anyone can show me a simple example with line break in aspose.slide
I have a web project using asp.net (VB code base) with a remark text field. the text field will allow user to input a text in point form. I need to slow that remark string into the powerpoint slide. however, it is not allow line break in aspose.slide. Does anyone can show me a simple example ??
1. shape.TextFrame.Text = “Text with \n line breaks”
2. Dim sometext As String = “Text with \n line breaks” Dim paras As Paragraphs = shape.TextFrame.Paragraphs
Dim delimiters() As Char = New Char() {"\r"c, "\n"c}
Dim split() As String = sometext.Split(delimiters) paras(0).Portions(0).Text = split(0) Dim i As Integer For i = 1 To split.Length - 1 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 ) Next
for (int i = 1; i < split.length; i++) { paras.add(i, new Paragraphs(paras[i - 1])); paras.get(i).getPortions().clear(); paras.get(i).getPortions().add(new Portion(paras.get(0).getPortions().get(0))); paras.get(i).getPortions().get(0).setText(split); }
I changed the code according to your code but it is still giving an error at
paras.add(i, new Paragraphs(paras[i - 1]));
The error is:
java.lang.Error: Unresolved compilation problems:
The method add(Paragraph) in the type Paragraphs is not applicable for the arguments (int, Paragraphs)
The type of the expression must be an array type but it resolved to Paragraphs
at com.novartis.pptutilwithAspose.ComplianceInitiativeOverviewPage.createAndShowComplianceInitiativeOverviewPage(ComplianceInitiativeOverviewPage.java:61)
at com.novartis.pptutilwithAspose.Sample.main(Sample.java:80)