Hi,
I’m building a document using the aspose word control and at some point I have to append other documents to the beginning or the end of the main one. My problem is that some of these documents have or not break page on the top respectively on the end of the document, but when I import the sections, all the documents are treated equally, meaning that all of them have break page. I tried to set the "SectionStart"to continuous on the main document and on the source document, but I didn’t get any result. The main issue with this is that we want to allow our users to be able to set themselves the page breaks when they see fit.
Here is a code sample:
Document doc = new Document(content);
DocumentBuilder builder = new DocumentBuilder(doc);
foreach(var include in includes)
{
Document includeDoc = new Document(include[1]);
if (includeType == IncludeTypes.FirstPage)
builder.MoveToDocumentStart();
else
builder.MoveToDocumentEnd();
foreach(Section section in includeDoc)
{
Node newSection = doc.ImportNode(section, true, ImportFormatMode.KeepSourceFormatting);
if (includeType == IncludeTypes.FirstPage)
doc.InsertBefore(newSection, builder.CurrentSection);
else
doc.InsertAfter(newSection, builder.CurrentSection);
}
}