Complex grid breaks for two templates - Attachment4, Attachment 5

Complex grid documents are moving to next line when merged with Aspose. Attaching the Aspose Generated along with attachments.

Aspose Generated.docx (186.7 KB)
Attachment1.docx (25.9 KB)
Attachment2.docx (113.0 KB)
Attachment3.docx (19.1 KB)
Attachment4.docx (49.4 KB)
Attachment5.docx (27.5 KB)

@NIKHIL.AGGARWAL30.OPTUM.COM Actually there are several problems upon merging the document. The main is that table in the Attachment4.docx is broken upon import.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-24929

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The second issue, your documents were created using different version of MS Word and as a result have different set of compatibility options. When you concatenate the documents compatibility options of the main document are applied and the content is reflowed appropriately. This might lead to difference in layout of the appended documents.

The third issue is that some of your documents does not have headers/footers, but they are inherited form the previously appended documents. You can avoid this using HeadersFooters.LinkToPrevious method. But in this case an empty headers/footers are added to the section that also might push the content down. You can reset size of empty paragraphs in headers/footers to avoid this:

string[] docs = new string[] {
    @"C:\Temp\Attachment1.docx",
    @"C:\Temp\Attachment2.docx",
    @"C:\Temp\Attachment3.docx",
    @"C:\Temp\Attachment4.docx",
    @"C:\Temp\Attachment5.docx"
};

Document result = null;
foreach (string path in docs)
{
    Document doc = new Document(path);
    doc.FirstSection.PageSetup.SectionStart = SectionStart.NewPage;
    doc.FirstSection.HeadersFooters.LinkToPrevious(false);

    if (result == null)
        result = doc;
    else
        result.AppendDocument(doc, ImportFormatMode.KeepSourceFormatting);
}

// Reset size of empty headers/footers.
NodeCollection headersFooters = result.GetChildNodes(NodeType.HeaderFooter, true);
foreach (HeaderFooter hf in headersFooters)
{
    if (string.IsNullOrEmpty(hf.ToString(SaveFormat.Text).Trim()))
        hf.FirstParagraph.ParagraphBreakFont.Size = 0;
}

result.Save(@"C:\Temp\out.docx");

I have tried with given code but still on page number 4th grid is getting broken and moved to next page.

Check screenshot image.png (18.4 KB)

I have attached document after using given code.
Merged_d6d5caf0-73e2-4b9e-aca0-cfbf8e459ad3_638113044588939288.docx (190.7 KB)

@Dhanashri0709 Yes, as I have mentioned in my previous answer, this problem has been logged as WORDSNET-24929. Currently the issue is in the queue for analysis. We will keep you updated and let you know once it is resolved or we have more information for you.

Can you please tell me approximately how much time it will take for analysis?

@Dhanashri0709 It is difficult to tell for sure. Usually new issues are analyzed within one-two weeks.

Oh. :frowning:

It will be great if you guys able to do respond on this issue as possible as.

Thank you for response :slight_smile:

1 Like

Any update on this?
We have stuck with this issue so because of that we cannot release this on production with aspose.

@Dhanashri0709 Unfortunately, there are no news regarding the issue. The issue is still in the queue for analysis. We will keep you updated and let you know once it is resolved or we have more information for you.

1 Like

Any update on this?

It’s removing below element randomly after merging the attachment4.

<w:vMerge w:val=“restart” />

@Dhanashri0709 Unfortunately, there are not news yet. We will keep you updated and let you know once it is resolved or we have more information for you.

@alexey.noskov Is this issue fixed? open since February.

@uttamvs, we have completed the analysis of the issue. Unfortunately, we cannot provide you any reliable estimate when it will be resolved as the issue is quite complex.

@denis.shvydkiy we are using license version of aspose and this issue is impacting our business. the same is working fine with OpenXML merging.

@uttamvs, please accept our apologies for your inconvenience. We will deliver the fix according to the terms mentioned in Free Support Policies.

You can obtain Paid Support Services. In this case the issue will be treated on priority basis, along with the direct access to our Paid Support management team. Purchasing Paid Support Services will push the issue upper in the queue.

@denis.shvydkiy what is the timeline to provide fix in free support? it’s been opened from last five months.

@uttamvs, according to Free Support Policies, there is no timeline for fixes in free support. New issues get in the queue, and their resolution depends on complexity and relationship with other issues.

You mentioned that the issue is not reproducible with OpenXML SDK. If it’s not too much trouble for you, could you please post a sample code that shows how OpenSDK handles the table in Attachment4.docx? I would forward this sample code to our development team so they can check whether it can help them.

@denis.shvydkiy it’s not a new table we are creating. The table is already in template and it’s removing “<w:vMerge w:val=“restart”/>” tag from letter after merging with other documents but somehow OpenXML SDK is managing this very well.

It would be appreciated if you let us know why “<w:vMerge w:val=“restart”/>” this tag is removing? so that we can work on updating the table structure in template.

HCFA.docx (48.0 KB)
@denis.shvydkiy look at this template it has table with merged cells