Trying to add text in builder
Firstline…secondline …thridline of paragraph in builder.writeln()
Expected alignment should be
Firstline…
secondline…
thridline…
but currently displaying as
Firstline…
Space Secondline …
Space thridline…
Trying to add text in builder
Firstline…secondline …thridline of paragraph in builder.writeln()
Expected alignment should be
Firstline…
secondline…
thridline…
but currently displaying as
Firstline…
Space Secondline …
Space thridline…
Please try the following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Firstline…" + ControlChar.LINE_BREAK +
"secondline…" + ControlChar.LINE_BREAK +
"thridline");
doc.save("E:\\temp\\awjava-20.6.docx");
Hardcoding is not possible.
But in paragraph we dont know each line right… just based on words space it will go to next line
You can replace any string of text (dots, spaces etc) with Line Breaks. Please try running the following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("Firstline...secondline...thridline");
doc.getRange().replace("...", ControlChar.LINE_BREAK);
doc.save("E:\\temp\\awjava-20.6.docx");
… is just sample text lets consider paragaraph with more than 3 lines
To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:
As soon as you get these pieces of information ready, we will start further investigation into your scenario and provide you more information. Thanks for your cooperation.