inheritaustralia wrote:Hi Brian,
Mixed orientation actually exists in Word.
See MS page:
Search for "word add landscape page" in google (can't add urls here)
Is this functionality available via Spire.Doc library?
Thanks,
Rafael.
Hello,
Thanks for your inquiry.
This is Abel from E-iceblue support team. For your requirement, you can refer to the following code snippet, and I put the input file and output file of the code below for your reference.
If you have any issue, just feel free to contact us.
- Code: Select all
//Load the word file
Document doc = new Document();
doc.LoadFromFile(@"../../data/input.docx");
//Add a new section
Section newSection = doc.AddSection();
//Set the orientation for the new section
newSection.PageSetup.Orientation = PageOrientation.Landscape;
//Add a new paragraph in the new section
Paragraph para = newSection.AddParagraph();
para.AppendText("2.This is landscape page in a new section");
//Save the result word file
doc.SaveToFile(@"../../output/output.docx", FileFormat.Docx);
Sincerely
Abel
E-iceblue support team
Login to view the files attached to this post.