Hi,
I have document with 2 tables. Between these tables is one paragraph. I expect by removing the Paragraph that will be tables merged on the same way as it does by Word.
Original document : tableMerge.docx
When I open document by Word and simply delete paragraph that is between tables, tables will be merged on natural way. Result document : mergedProperly.docx
If I do that with Aspose and following code snippet I fails adn get unexpectedly merged table. Result document : mergedWrongly.docx
Code snippet
public static void MergeTables()
{
Aspose.Words.Document doc = new Aspose.Words.Document(@"");
List paras =
doc.FirstSection.Body.GetChildNodes(NodeType.Paragraph, false)
.Cast()
.ToList();
foreach (Aspose.Words.Paragraph para in paras)
{
if(para.GetText().StartsWith("sss"))
{
para.RemoveNodeSafely();
}
}
string documentName = @"";
doc.Save(documentName, SaveFormat.Docx);
}
Could you please let me know how to accomplish that ?
Thanks,
Rastko
Hi Rastko,
Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13599. You will be notified via this forum thread once this issue is resolved.
We apologize for your inconvenience.
Hi Rastko,
I can’t see your attachment, but from the description, it could be similar problem to the one I have. See this thread, Consecutive tables joined incorrectly if page numbering is used - Free Support Forum - aspose.com, there is a workaround there (marked in yellow), maybe it will work for you until you get a valid fix.
Best wishes,
Krzysztof
Thanks,
just to clarify, this is only a workaround, you will place fix for this in next release ?
Thanks,
Rastko
In case when we are inserting several tables one by one that are different we can not apply this workaround. We need to apply this AutoFitBehavior only on some tables. As this is a dynamicprocess I can not know on which to apply.
We will wait for regular fix to process further.
Hi Rastko,
Thanks for your inquiry. Yes, call of Table.AutoFit(AutoFitBehavior.FixedColumnWidths) method is workaround of this issue. We will update you via this forum thread once this issue is resolved.
Thanks for your patience.
The issues you have found earlier (filed as WORDSNET-13599) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
It works now as it was expected.
Thank you,
Rastko