We are facing issue while appending one document after other. Actually our requirement is to keep both document formatting as is and append one document after other without changing any style or formatting of any of the document.
Current method destinationDoc.AppendDocument(sourceDoc, AW.ImportFormatMode.UseDestinationStyles);
which we are using is forcing us to keep either source or destination style. if we choose KeepDifferentStyles option still it impose formatting changes.
Do we have method where it keeps both the document formatting separate and lets use it. please lets know if we need to provide more inputs and a prioritization will help us in resolving our issues quickly? Also lets know if you need specific document to research further, though it may be bit difficult as it has lots of client data.
Your expected file showing the desired output. You can create this document by using MS Word.
A comparison screenshot highlighting the problematic areas in this Aspose.Words 20.6 generated document (with respect to your expected file)
Please also create a standalone simple Console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size
As soon as you get these pieces of information ready, we will start investigation into your particular scenario and provide you more information. Thanks for your cooperation.
P.S: It is safe to attach files in the forum. If you attach your documents/resources here, only you and Aspose staff members can view/download them. You can also remove any sensitive information from documents by replacing it with dummy data instead.
However, if you want to save final (combined/appended) document to Word formats such as DOCX, DOC, RTF by using Aspose.Words alone, then I am afraid, the simplest way is to use Document.AppendDocument Methods. It accepts an ImportFormatMode enumeration parameter which defines how conflicting styles are handled when one document is imported into the other. As shown in following screenshot, when you try to copy content of one Word document inside another document, MS Word will also present you different Paste options.
Thanks for your response, meantime we have created sample files and application to show you exact issue. please find attached sample application and dummy files.
dummy application will be sharing back in a day as it seems it size doesn’t allow me to upload it.
The “CollatedFile.pdf” was actually produced by using an old 19.12 version of Aspose.Words for .NET on your end. We suggest you to please upgrade to the latest 20.7 version and see how it goes on your end?
We have also produced a PDF file by running your code with 20.7 version on our end and attached it here for your reference. (see pdffile_1157397795.pdf (153.1 KB))
Do you see the same problem in above “pdffile_1157397795.pdf”? If yes, then please ZIP and attache the following resources for further testing:
Instead of PDF, save final document to DOCX format
Your expected file showing the desired output. You can create this document by using MS Word.
A comparison screenshot highlighting the problematic areas in above Aspose.Words 20.7 generated document (with respect to your expected file)
We will then start further investigation into your particular scenario and provide you more information.