Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Aug 12, 2016 11:33 pm

After i tried to merge 11 files the final document lost formats in some parts and it doesn´t append the page break in some of the documents or it appends a page break(continues)

Code: Select all
                var template = new Document();
                var toMerge = new Document();
                template.LoadFromFile("firstDocxFilePath", FileFormat.Docx);

                foreach (var f in fileCollection)
                {
                    toMerge.LoadFromFile(f.Path, FileFormat.Docx);
                    foreach (Section sec in toMerge.Sections)
                    {
                        template.Sections.Add(sec.Clone());
                    }
                }

                template.MailMerge.Execute(table);
                template.SaveToFile("MergedDocument", FileFormat.Docx);
            }

vargas
 
Posts: 2
Joined: Mon Aug 01, 2016 10:35 pm

Mon Aug 15, 2016 3:19 am

Dear vargas,

Sorry for late reply as weekend.
Please provide us the files( template file and toMerge file which encountered the issue) for our testing, and then we will do an investigation and update to you ASAP.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Wed Aug 17, 2016 1:15 pm

Sorry, we can not give files for privacy.

vargas
 
Posts: 2
Joined: Mon Aug 01, 2016 10:35 pm

Thu Aug 18, 2016 2:21 am

Dear vargas,

Thanks for your feedback.
Please try to use the latest Spire.Doc Pack(hot fix) Version:5.7.72 firstly and create a new document and then clone all files into it, not set one of them as target document, as the result document will be the same format as the target document and maybe this is the reason that cause the issue. If the issue still presists, the better to send sample document(you can change/remove the confidential information as long as the file can reproduce your issue) to us( Support@e-iceblue.com) via email, we promise to keep it confidential and won’t use it for any other purpose. That would be very helpful to investigate this issue.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy
 
Posts: 802
Joined: Mon Jan 19, 2015 6:14 am

Return to Spire.Doc