Header Page Number Setting

Technical support for Spire.Doc

Moderator: iceblue support

Header Page Number Setting

Postby eternalsummer » Wed Jan 26, 2011 3:08 am

I want to set the page header with special format, for example, the first page, total five pages. And the header should be put on the right. Can you help me?
Thanks in advance.
eternalsummer
 
Posts: 11
Joined: Mon Dec 13, 2010 7:31 am

Re: Header Page Number Setting

Postby iceblue support » Wed Jan 26, 2011 9:28 am

Thank you for your inquiry! :P
You may append field in the paragraph and append page number into the field. Further more, you may set headerParagraph.Format.HorizontalAlignment property of the header paragraph to specify the alignment of the text.
Code: Select all
Paragraph headerParagraph = header.AddParagraph();
headerParagraph.AppendField("page number", FieldType.FieldPage);
headerParagraph.AppendText(" of ");
headerParagraph.AppendField("number of pages", FieldType.FieldNumPages);
headerParagraph.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Right;
e-iceblue support
User avatar
iceblue support
 
Posts: 244
Joined: Tue Dec 21, 2010 2:56 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests

cron