Microsoft KB Archive/184193

= WD: How to Print a Page Number Sideways (PostScript) =

Article ID: 184193

Article Last Modified on 10/6/2003

-

APPLIES TO


 * Microsoft Word 6.0 for Macintosh
 * Microsoft Word 98 for Macintosh

-



This article was previously published under Q184193





SUMMARY
In Microsoft Word for Macintosh, you can print a page number sideways (at a 90-degree angle from the rest of the document's orientation) by inserting PostScript commands.



MORE INFORMATION
The following steps assume that your document has the following attributes:

Margin Settings:

Top: 1"

Bottom: 1"

Left: 1.25"

Right 1.25"

From Edge:

Header: 0.5"

Footer: 0.5"

The page number field in the footer must be flush left and must be the first line in the footer.

To rotate the page number with a Print field code and PostScript code, follow these steps:

 On the Insert menu, click Field. Under Categories, select All, and under Field Names, select Print. Click Options, select \p page, and then click Add To Field. Click OK to return to Word. Press OPTION+F9 to show field codes. You should see the following:

{PRINT \p page \* MERGEFORMAT}

  Type the following text within in the field braces so that it looks exactly like the following: { PRINT \p page "% Rotate Landscape Page Numbers  % This is set to mimic footer page numbers that are flush right, 12-   % point Times-Roman.   % The document margins should be Top and Bottom 1" left, right 1.25".   0 0 moveto   /Times-Roman findfont 12 scalefont setfont   /StrLength {(Page ) stringwidth pop wp$fpage stringwidth pop add} def

% To move the position of the text, modify the following settings. % If you need to move the text to the right increase the number in  % PoinstFromTop. /PointsFromRight {6} def /PointsFromTop {120} def /PointsFromBottom {42} def

/UpperMiddle {wp$x PointsFromTop sub wp$y 2 div StrLength 2 div add} def /UpperRight {wp$x PointsFromTop sub wp$yorig PointsFromRight add StrLength add} def /BottomMiddle {wp$xorig PointsFromBottom add wp$y 2 div StrLength 2 div add} def /BottomRight {wp$xorig PointsFromBottom add wp$yorig PointsFromRight add StrLength add} def

% NOTE: You can use any one of the following four lines. To change the % position of the page number, place a percent sign in front of the % "UpperRight moveto" line, and remove the percent sign from the line % that contains the position you want the page number to be in.

%UpperMiddle moveto UpperRight moveto %BottomMiddle moveto %BottomRight moveto

0 rotate (Page ) show wp$fpage show "}                       

NOTE: The code has instructions for changing the location and position of the page number.

Once you have created the code, you may want to create an AutoText entry for it. To do this, follow these steps:


 * 1) Select the entire code, including the field braces.
 * 2) On the Edit menu, click AutoText, type in a Name for the AutoText entry, and then click Add.

Explanation of Some of the Lines of Code Listed in this Article
/Times-Roman findfont 12 scalefont setfont

Sets the font and font size.

/PointsFromRight {36} def

Sets the distance in points from the right edge of the paper to the baseline and starting edge of the first character in the page number. This measurement applies to page numbers that appear at the upper right or bottom right in portrait position.

/PointsFromTop {36} def

Sets the distance in points from the top edge of the paper to the page number. This measurement applies to page numbers that appear at the upper right or upper middle in portrait position.

/PointsFromBottom {36} def

Sets the distance in points from the bottom edge of the paper to the page number. This measurement applies to page numbers that appear at the bottom right or bottom middle in portrait position.

/StrLength { (Page )...

(Page ) show Specifies the characters that will precede the page number. If you don't want any characters to precede the page number, delete all characters within parentheses in both lines of code shown.

For additional information, please see the following article in the Microsoft Knowledge Base:

180097 WD98: How to Print a Page a Page Number Sideways

Keywords: kbhowto kbprint kbfield kblayout KB184193

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.