[OfficeUtils] Soft Return or New Line does not work in Word Document Generating (OfficeUtils)

[OfficeUtils] Soft Return or New Line does not work in Word Document Generating (OfficeUtils)

  
Forge Component
(17)
Published on 26 Apr by Elena Novozhilova
17 votes
Published on 26 Apr by Elena Novozhilova

Hi,

I am trying to load a word template and export it. 

And i realized that the "Soft return" (Shift + Enter) formatting seems not working. The line break seems to have become a page break, e.g. the template have two "shift + enter", there will be 2 empty pages inserted.

Any thought on this?


Thanks.

Elliot CJ wrote:

Hi,

I am trying to load a word template and export it. 

And i realized that the "Soft return" (Shift + Enter) formatting seems not working. The line break seems to have become a page break, e.g. the template have two "shift + enter", there will be 2 empty pages inserted.

Any thought on this?


Thanks.

Hi Elliot,


Line breakes (result of pressing SHIFT + ENTER) are somehow being replaced by the component with pagebreacks on the generated file.

My advice would be to replace on the template line breaks with regular line terminators (result of pressing ENTER). 

Best regards,

Elena

Hi Elena,


Thanks for your reply.

There some differences between "enter" and "shift enter". Hope this bug will be resolved in next release.


OfficeUtils is a handy tool. Appreciate your hard work and effort.


Thanks,

Elliot

Elliot CJ wrote:

Hi Elena,


Thanks for your reply.

There some differences between "enter" and "shift enter". Hope this bug will be resolved in next release.


OfficeUtils is a handy tool. Appreciate your hard work and effort.


Thanks,

Elliot

Unfortunatelly the line break issue is cause by the underlying library (NPOI) and not OfficeUtils implementation. Between the document loading and the document writing NPOI replaces somehow the line breaks by page breaks. At this moment I'm not sure we will be able to create a workaround for this, but I will do some research.

In the meanwhile I would suggest you to use ENTER instead of SHIFT + ENTER and then adjust the paragraph properties so that the spacing between lines is 0.

Elena