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.

Wed Dec 29, 2010 2:02 am

Hello,
I need to set footers in Word. I got the information. But there is a problem that is bothering me.
I want to get different footers for a section's odd-even pages. My query is how can I do with Spire.DOC.
Thanks!
Last edited by ted on Wed Jan 12, 2011 4:05 am, edited 2 times in total.

ted
 
Posts: 7
Joined: Tue Dec 21, 2010 9:01 am

Tue Jan 04, 2011 3:46 am

Thank you for your inquiry!
To do so you can follow the source codes below:
section.PageSetup.DifferentOddAndEvenPagesHeaderFooter = true;
Paragraph efp = section.HeadersFooters.EvenFooter.AddParagraph();
efp.Format.HorizontalAlignment = HorizontalAlignment.Right;
efp.AppendField("page number", FieldType.FieldPage);

Paragraph ofp = section.HeadersFooters.OddFooter.AddParagraph();
ofp.AppendField("page number", FieldType.FieldPage);

The headers are as same as the footers.
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Thu Jan 13, 2011 5:31 am

Otherwise, can we set odd-even pages just like a book that is odd pages are on the right side and even pages are on the left side?
Thanks!

ted
 
Posts: 7
Joined: Tue Dec 21, 2010 9:01 am

Tue Jan 18, 2011 5:11 am

When I set the format of word header, I want to modify the border of the header. How can I draw a line with dot and dash of the header border?

ted
 
Posts: 7
Joined: Tue Dec 21, 2010 9:01 am

Tue Jan 18, 2011 8:34 am

Thank you for your inquiry!
You may set the headerParagraph.Format.Borders.Bottom.BorderType property to realize it. In Spire.Doc, two formats matches your need. One is Spire.Doc.Documents.BorderStyle.DotDash, the other one is Spire.Doc.Documents.BorderStyle.DotDotDash. You can choose one you like.
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.Doc