Hi,
In the legacy code there were replaceable symbols like #$NL. With latest pdf version this is not working. System is displayed as is in the pdf document.
TextFragment fgmt = new TextFragment();
TextSegment segment = new TextSegment(“line1 #$NL line2”);
fgmt.getSegments().add(segment);
How can we use these symbols?
Thanks
Mamatha
Hi Mamatha,
Thanks for contacting support.
The new DOM approach do not support Replaceable symbols from legacy Aspose.Pdf for Java, except $p and $P. In order to add line break, please try using following code snippet.
[Java]
com.aspose.pdf.Document doc = new com.aspose.pdf.Document();<o:p></o:p>
doc.getPages().add();
TextFragment fgmt = new TextFragment();
com.aspose.pdf.TextSegment segment = new com.aspose.pdf.TextSegment("line1 \r\nline2");
fgmt.getSegments().add(segment);
doc.getPages().get_Item(1).getParagraphs().add(fgmt);
doc.save(“c:/pdftest/LineBreakTest.pdf”);