Does Aspose.Words.Document.AppendDocument adds always SectionBreak (Continuous) or I can manage to be Page Break or something else ?
Also is it possible to avoid adding of Continuous section break ?
Thanks
Does Aspose.Words.Document.AppendDocument adds always SectionBreak (Continuous) or I can manage to be Page Break or something else ?
Also is it possible to avoid adding of Continuous section break ?
Thanks
Hi Rastko,
Thanks for your inquiry. Please use PageSetup.SectionStart property to get or set the type of section break for the specified object. We suggest you please read following documentation link for your kind reference.
Specifying How a Document is Joined Together
In your case, we suggest you please use PageSetup.SectionStart property to change the section break type before appending the document.
// The document that the content will be appended to.
Document dstDoc = new Document(MyDir + "Doc1.docx");
// The document to append.
Document srcDoc = new Document(MyDir + "Doc2.docx");
srcDoc.FirstSection.PageSetup.SectionStart = Aspose.Words.SectionStart.NewPage;
dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
// Save the document.
dstDoc.Save(MyDir + "Out.docx");
Thank you for your response.
This will insert section page break, I would like to add just page break. Is it possible to do something like that ?
Thanks,
Rastko
Hi Rastko,
Thanks for your inquiry. Please use following code example to achieve your requirements. We suggest you please read following documentation link. Hope this helps you.
Inserting Document Elements
// The document that the content will be appended to.
Document dstDoc = new Document(MyDir + "Doc1.docx");
DocumentBuilder builder = new DocumentBuilder(dstDoc);
// The document to append.
Document srcDoc = new Document(MyDir + "Doc2.docx");
builder.MoveToDocumentEnd();
builder.InsertBreak(BreakType.PageBreak);
builder.InsertDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
// Save the document.
dstDoc.Save(MyDir + "Out.docx");
Thank you Tahir