We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Inserting Tables into Documents always adds default "Spacing After" of 10pt

I create the table from scratch in Aspose.Word. At that time it looks perfect. I set the "Spacing After" to 0 in code when it is created. The destination document has an after spacing set to 0. Then I insert into the destination document with the "KeepSourceFormatting" set using the following code.

NodeImporter importer = new NodeImporter(srcDoc, insertAfterNode.Document, ImportFormatMode.KeepSourceFormatting);

Does anyone know why it keeps setting the spacing to 10pt?

Thanks,

Bryan

Hi

Thanks for your inquiry. Could you please attach your code, input and output documents here for testing? We will check the issue and provide you more information.

Best regards,

Sure. I have tried to append, insert, and finally merge the tables into the destination documents. I will give you the code for appending, its input and outputs then I will attach another posts using the merge callback.

Hi there,

Thanks for this additional information.

We will wait for your inputs. Please note that we need your input and output documents as well.

Thanks,

Append or Insert separate Table document (Source) to separate destination document using Mail Merge.

TableBalanceSheet5Columns is the table (source document)

Section5_BalanceSheets.docx is the destination file.

AsposeWordClass is the C# code that I use to run the mail merge.

My code calls

MergeListofDocuments() to process the two files and the eventual call to MailMerge that I have added the

FieldMergingCallback handler.

The other approach that I tried just takes the two files as source and destination and appends them or inserts them KeepSourceStyling turned on or off in GeneralFileOperations.GenerateTOCReport2(...)

I will try today to put together an example with me code.

Both methods result in an elongated table as seen in LinkConnector.docx.

Hi there,

Thanks for your inquiry.

I managed to reproduce the issue on my side. I'm afraid there is no easy fix for this issue though. You can find the reason for why this happening in the Join and Append Documents article here under "After appending my document to another document the line spacing between some paragraphs in the resulting document has changed" near the end of the article.

Your source document appeared very stubborn and the issue didn't disappear until I copied the content into a brand new document.

Thanks,

Thanks for your time on this. Did you programmatically add the source content to a new Apose document and then append the documents?

Bryan

Hi Bryan,

Thanks for your inquiry. My apologises, let me clarify that. I copied the content into a new document within Microsoft Word. This is the easiest way to ensure the document has the default settings within styles.xml.

Thanks,

Brainstorming:

Do you think I can unzip the word file, find the AfterSpacing = "Auto" or "10" and change it to "0". Then zip it back and save it with Aspose.Words to ensure it does not have any errors?

Thanks,

Bryan

Hi Bryan,

Sure, this is what I had to do during testing. Settings the defaults through MS Word has no effect. I think copying the content of the source document into a new document would be easier though.

Thanks,

The issues you have found earlier (filed as WORDSNET-2098) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(2)

The issues you have found earlier (filed as WORDSNET-2098) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.