Section Behaviour when Merging Documents
TX Text Control X9 is going to have separate headers and footers for Odd and Even pages. In combination with First Page Headers, First Page Footers, different sections and the new per section restartable page numbering, headers and footers can get a very complex structure. The current version TX Text Control X8 also implements many different section combinations. In the next couple of blog entries, I am going to introduce special section situations where TX Text Control implements a number…

TX Text Control X9 is going to have separate headers and footers for Odd and Even pages. In combination with First Page Headers, First Page Footers, different sections and the new per section restartable page numbering, headers and footers can get a very complex structure.
The current version TX Text Control X8 also implements many different section combinations. In the next couple of blog entries, I am going to introduce special section situations where TX Text Control implements a number of standard conventions.
Consider the following situation. Document 1 consists of 1 page and a section header. Document 2 has two sections and no headers and footers:


The second document is inserted into document 1 using Selection.Load, Append (StartWithNewParagraph) or clipboard operations.

These documents, the sections and headers and footers must be combined somehow in a way that makes sense. Over the years, conventions have been developed how such situations are resolved. The resulting document is a combination of the different sections. The following illustration shows how the resulting 2 sections are merged:

As you can see, the header has been moved to page 2. In fact, section 1 of document 1 (1a) has been merged with section 1 of document 2 (2a) where the format of the newly inserted document has priority (2a).
On page 2, the format of section 1 of document 1 (1a) is used, so that the header is applied to the second section on page 2.
This merge logic matches the behaviour of other word processors such as MS Word.
Related Posts
Windows FormsGetting StartedTutorial
Windows Forms Tutorial: Create Your First Windows Forms C# Application
This tutorial shows how to create your first Windows Forms application with C# using TX Text Control .NET for Windows Forms in Visual Studio 2022.
How to Mail Merge MS Word DOCX Documents in ASP.NET Core C#
Mail merge is the process of merging data, such as Json or IEnumerable objects, into a template document, such as a DOC or DOCX file. This tutorial is a walkthrough of the steps necessary to…
Creating an Angular Document Editor Application with a Node.js WebSocket Server
This tutorial shows how to create an Angular application that uses the Document Editor with a Node.js WebSocket server.
Adding SVG Watermarks to Documents
This article shows how to add SVG images to document section headers that repeat automatically on each page. This watermark will be inserted vertically and horizontally centered on each section page.
Using MailMerge in ASP.NET Core 6 Web Applications
This article shows how to use the TX Text Control ASP.NET MailMerge class to merge templates with JSON data within a .NET 6 application in Visual Studio 2022.