Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Nov 19, 2012 2:03 pm

Hi e-iceblue Team,

I was wondering whether it is possible to change the alignment of single sections to horizontal or vertical? I'd like some pages in my document to be vertical and some horizontal when printing.

Thanks in advance!

pbernhardt
 
Posts: 11
Joined: Thu Mar 03, 2011 1:55 pm

Tue Nov 20, 2012 5:47 am

Hi,

Thanks for your inquiry.
About setting the alignment of single sections to vertical, we provide you some sample code. But for horizontal alignment, we only support paragraph, we don't completely understand what you want.
Could you please provide us a sample document to show us the result about the horizontal alignment of section? So that we can do a demo for you. Thank you!

Code: Select all
Section section1 = document.Sections[0];
section1.PageSetup.VerticalAlignment = PageAlignment.Bottom;


Best regards,
Amy
E-iceblue support
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Nov 27, 2012 8:08 am

Hello,

We are wondering whether the code we provided has resolved the problem setting the alignment of single sections to vertical.
Did you still have the problem setting the alignment of single sections to horizontal? If you did, could you please provide us a sample document to show us the result about the horizontal alignment of section? So that we can quickly work out a solution for you. Thank you!

Best regards,
Amy
E-iceblue support
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Fri Dec 14, 2012 7:55 am

Hello Romy,

We have received your document from email. Spire.doc can support the featrue. We provide you some code below. Please try it, and tell us whether it works well on your side. If you have any problem, please feel free to contact us.
Code: Select all
            Document document = new Document();

            Section section = document.AddSection();
            section.BreakCode = SectionBreakType.NewPage;
            section.PageSetup.Orientation = PageOrientation.Portrait;

            section = document.AddSection();
            section.BreakCode = SectionBreakType.NewPage;
            section.PageSetup.Orientation = PageOrientation.Landscape;

            section = document.AddSection();
            section.BreakCode = SectionBreakType.NewPage;
            section.PageSetup.Orientation = PageOrientation.Portrait;
         
            document.SaveToFile("sample.docx",FileFormat.Docx);


Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Mon Dec 17, 2012 10:06 am

Hello Romy,

Could you please tell us does the demo resolve your problem?

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Mon Dec 17, 2012 3:55 pm

Hello Amy,

yes that resolved my problem. Thank you very much! :)

pbernhardt
 
Posts: 11
Joined: Thu Mar 03, 2011 1:55 pm

Tue Dec 18, 2012 1:29 am

Hello Romy,

Thanks for your feedback. :D
If you encounter other problems, please don't hesitate to contact us.

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc

cron