I am creating a document using Novacode DocX. I would like the entire document to be in landscape orienation, however I would also like to have several section breaks in the document. My code is laid out like this:
DocX doc = DocX.Create(fileName);
doc.PageLayout.Orientation = Novacode.Orientation.Landscape;
foreach (string page in pages)
{
doc.InsertSection(false);
Paragraph p = doc.InsertParagraph();
p.Append(page);
}
doc.PageLayout.Orientation = Novacode.Orientation.Landscape;
doc.SaveAs(Path.Combine(folderPath, fileName));
I've also tried adding doc.PageLayout.Orientation = Novacode.Orientation.Landscape
inside the loop after doc.InsertSection(false)
and I can't get anything past the first page to turn to landscape.
Is there a way around this?