How can I add multiple sections to one page? Now, when I use document.AddSection() a new page is automatically created in my document for each section, and I would prefer to have some sections on the same page if they fit.
Thanks
Document doc = new Document();
// Create a new section instance
Section section = doc.AddSection();
// Add a new paragraph
Paragraph paragraph = section.AddParagraph();
// Append text
paragraph.AppendText("This is the first section");
// Insert a continuous section break,now the document contains two section
paragraph.InsertSectionBreak(SectionBreakType.NoBreak);
// Get the second section
section = doc.Sections[1];
// Add a blank paragraph
section.AddParagraph();
// Add a new paragraph
paragraph = section.AddParagraph();
// Append text
paragraph.AppendText("This is the second section");
// Insert a continuous section break
paragraph.InsertSectionBreak(SectionBreakType.NoBreak);
doc.SaveToFile("result.docx");