We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to put enter instead of page break in document

Hi Team,

How to put enter instead of page break in the source document .Is this any work around solution for this problem in Aspose.

regards,
priyanga.G

@priyanga,

Thanks for your inquiry. Please use DocumentBuilder.InsertBreak method to insert a break of the specified type into the document. You can use BreakType as ParagraphBreak or LineBreak according to your requirement. Hope this helps you.

Document doc = new Document(MyDir + "in.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertBreak(BreakType.LINE_BREAK);

If you want to replace break break with line break, please use following code example.

Document doc = new Document(MyDir + "in.docx");
doc.getRange().replace(ControlChar.PAGE_BREAK, ControlChar.LINE_BREAK, new FindReplaceOptions());
doc.save(MyDir + "output.docx");

Hi @tahir.manzoor

Thanks a lot .

Exactly its working fine for my request.

Regards
priyanga.G