Body text moves automatically in every page after word merge in Ubuntu

WordMLTemplate.docx (60.8 KB)
GeneratedLetter.pdf (56.7 KB)
Hi Team,
We are using Aspose.Words for .NET for generating documents. Merging with template (wordml) works fine in most of the cases. But we are facing a problem when using the attached template (WordMLTemplate.xml) for merging with a data table containing only one value for barcode (LetterValue) - it is pushing body static data down in each page which results in one extra page in the generated document (attached)GeneratedLetter.pdf (56.7 KB)
. This problem happens only in Ubuntu environment and works fins when tested in windows environment.
Can you please help?

Thanks
Christina

@cmalayil Unfortunately, I cannot reproduce the problem on my side. Here is PDF document generated in Linux environment on my side: out.pdf (53.2 KB)

The problem might occur because versions of Calibri fonts are different in your Windows and Linux environments. Could you please attach your Calibri font from Linux here for testing?

Thanks for the prompt reply Alexey.
We copied over fonts folder from windows 11 to Ubuntu as we had font issues earlier.
Aspose.Words Fonts not rendering in Ubuntu while generating PDF using .NET Core (posted by my team mate).
So the versions are the same 6.23. Can you please think of anything else that could cause this issue?

Thanks!
Christina

@cmalayil As I can see in your output document barcode image is inserted into the MERGEBARCODE in the header. This increases height if the header and pushes the content. It looks like this causes the difference in layout.

But this should be a problem in windows env too right? But in windows env we can see it properly - no issues.

@cmalayil Could you please save the output document as DOCX in Windows and Linux environments and attach them here for testing? We will check the documents and provide you more information.

I am sorry Alexey, you are right. This is a problem both in windows and Ubuntu! I didn’t notice as barcode wasn’t rendering in windows for me earlier.
Can you please tell me how i can avoid this content push in the body? i understand header area growing but why is it inserting blank lines in the body before the text (Page1, Page 2 etc)…any idea?

thanks!
Christina

@cmalayil As you may know, MS Word documents do not have “page” concept due to their flow nature. Content of the document is reflowed into pages by consumer application. In your case Content is formatted using empty paragraphs:

Once content is pushed down one of the empty paragraph is moved to the next page:

and this occurs on every next page.

Thanks for the explanation Alexey. Is there a way to remove these empty paragraphs which are introduced only during merge (without touching the empty paragraphs that user internationally added) ?

@cmalayil The current behavior is expected. It is better to change the template and use page break instead of moving content to the next page using empty paragraphs.

Thanks Alexey, we will work with our template designer on this.

1 Like