I am having a hard time understanding your requirements. When you say you the sections themselves shouldn't break on page breaks
, do you mean that the concatenated document should flow without page breaks in it? If this is the case, there is a pretty straightforward way to do that by setting the layout mode
of the editor/document to Flow or FlowNoWrap.
The other thing that comes to mind is that you would like that each section in your document takes up no more that one page regardless of how much contents a section contains, is that correct? If this is the case the solution might not be so easily implementable.
If each section in your document contains less text than a single page, you can use the approach shown in Boby's post by inserting page/section breaks between your separate pieces of content (the document fragments).
RadDocument mergedDocument =
If not all sections can fit on a page, you can try setting different page sizes to the sections respectively to
their contents. This can be done using the PageSize
property of Section
. However, in order to adopt such approach you should determine whether a section has more than one layout box, for example like this:
(section.GetAssociatedLayoutBoxes().Count() > 1)
//...change page size
The latter, however, might not work so well for very large sections.
If I misunderstood you please elaborate a bit more on your requirements, so I can be of more help.