Page 1 of 1

Layout and line break

PostPosted: Tue Apr 26, 2016 7:40 pm
by Mattig
Hello docx communauty

We have a problem.

We have a model word where there are some text which will be replaced by values dependant on the context.
If the values contain some line break, the word document won't have a good layout.

We replace line break by
Code: Select all
</w:t></w:r><w:r><w:br/><w:t>


We notice that if we replace by
Code: Select all
</w:t></w:r></w:p><w:p w:rsidR=\"00C6707D\" w:rsidP=\"00C6707D\" w:rsidRDefault=\"00414BBD\"><w:r><w:t>


. It's ok.

I'm not sure to understand what means the code w:rsidR, w:rsidP, w:rsidRDefault, but it's clear that is contain informations about font-size, font etc etc.

The difficulties is that we do the replacement with velocity, so we can't know the good values for w:rsidR, w:rsidP, w:rsidRDefault .

I have the impression that i have to parse the docx after the first replacement, and i have to replace
Code: Select all
</w:t></w:r><w:r><w:br/><w:t>


by paragraph with correct ID

Does anyone meet and solve this problem ?

Best regards
Matthieu

Re: Layout and line break

PostPosted: Tue Apr 26, 2016 8:48 pm
by jason
Mattig wrote:the code w:rsidR, w:rsidP, w:rsidRDefault, but it's clear that is contain informations about font-size, font etc etc


No, these are about revisions and document merging. See https://blogs.msdn.microsoft.com/brian_ ... ose-rsids/

I get that you are using Velocity, but I'm not sure what you are asking here.