Page 1 of 1

New line in between the paragraph

PostPosted: Tue May 16, 2023 10:41 pm
by harish0000
Hi

I want to add a new line in between a paragraph which is already justified. Lets say there are 3 sentences in paragraph and I want to add a new line after 1st sentence.

Approach used
I have placed a variable ${a.newLine} then replace that variable with </w:t><w:br/><w:t>. Now Line is successfully added but since the paragraph is justified this new line added is a "shift+enter" line due to which it creates large spaces in 1st sentence which looks ugly and not appropriate.

What I want is to create a new line after 1st sentence. One approach would be to add a new paragraph. but how I can add just after 1st sentence. ?

Please help how we can do this

Re: New line in between the paragraph

PostPosted: Wed May 17, 2023 8:37 am
by jason
Best to figure out how you'd do it in Word, then replicate in docx4j?

If justify left is not appropriate, then yes, you probably need a second paragraph.

You'll have to find the w:r/w:t containing the full stop, then split it into 2, then move the second of these and the following list content into the new paragraph's list.