WD: Changing Page Number Formats with PostScriptLast reviewed: October 20, 1997Article ID: Q92797 |
The information in this article applies to:
SUMMARYIn Microsoft Word, you can use PostScript code to change the starting page number in a section. For instance, you can have a 20-page document with the first 10 pages numbered from 1 to 10 and the last 10 pages numbered from 15 to 24. You can also change the position of the page numbers on the page and change the font and font size of the page numbers.
TO CHANGE THE STARTING PAGE NUMBER
CUSTOMIZATION
Page Number PositionThe preceding sample PostScript code prints the page number in the upper-right corner of the page. To change the position of the page number, replace line 6 of the above code with the desired location of the page number from the lower-left edge of the page. For instance, to print the page number at the center and bottom of the page, change the line to read:
4.25 inch .5 inch movetoThese numbers represent specific positions on the page. The first number is the horizontal position, where the left edge of the page is 0 (zero). The second number is the vertical position, where the bottom of the page is 0. These measurements assume an 8.5-by-11-inch sheet of paper.
Font and Font SizeThe preceding sample PostScript code prints the page numbers in Times 12-point type. To change the font and font size, replace the font name and font size in line 5 with the PostScript name and number of the font you want. To find the PostScript name for the font you want, see the list below or use the Apple(R) LaserWriter(R) utility that comes with the printer. For example, to print the page number in Palatino(R) 10 point, change the line to read:
/Palatino-Roman findfont 10 scalefont setfontThe following is a list of 35 standard typefaces resident in almost all PostScript printers. "Demi" is bold, "Oblique" is italic, and "Book" and "Roman" are plain type.
AvantGarde-Book AvantGarde-BookOblique AvantGarde-Demi AvantGarde-DemiOblique Bookman-Demi Bookman-DemiItalic Bookman-Light Bookman-LightItalic Courier Courier-Bold Courier-BoldOblique Courier-Oblique Helvetica(R) Helvetica-Bold Helvetica-BoldOblique Helvetica-Narrow Helvetica-Narrow-Bold Helvetica-Narrow-BoldOblique Helvetica-Narrow-Oblique Helvetica-Oblique NewCenturySchlbk-Bold NewCenturySchlbk-BoldItalic NewCenturySchlbk-Italic NewCenturySchlbk-Roman Palatino-Bold Palatino-BoldItalic Palatino-Italic Palatino-Roman Symbol Times-Bold Times-BoldItalic Times-Italic Times-Roman(R) ZapfChancery-MediumItalic ZapfDingbatsThe fonts in the preceding list are installed on the following LaserWriters:
LaserWriter Plus LaserWriter IINT LaserWriter IINTX Personal LaserWriter NT LIMITATIONS
PRINTING THE WORD "PAGE" IN FRONT OF THE PAGE NUMBERTo print the word "Page" in front of the page number, three lines need to be inserted in the PostScript code. The text below is the modified PostScript code. The added lines begin with an asterisk. Do not enter the asterisk in the actual code.
/startnum 15 def /pgnum 4 string def /temp 4 string def /inch {72 mul} def * /Text (Page ) def /Times-Roman findfont 12 scalefont setfont 8.0 inch 10.5 inch moveto /pgnum {wp$page startnum 1 sub add temp cvs} def pgnum stringwidth pop neg 10 neg rmoveto * Text stringwidth pop neg 0 rmoveto * Text show pgnum showThe above code will have the PostScript style applied to it. Description of inserted lines:
/Text (Page ) def This line defines the variable "Text". When this variable is printed, the word "Page " (with a space after it) will print. Text stringwidth pop neg 0 rmoveto Text show These two lines print the word "Page" to the right of the page number. MORE INFORMATIONFor more information about learning PostScript, please see "Learning PostScript: A Visual Approach" by Ross Smith (Berkeley: Peachpit Press, 1990). For more information about using PostScript with Microsoft Word, please see the following resources: "Using Microsoft Word"version 5.0, 5.1, Appendix G "Reference to Microsoft Word," version 4.0, pages 284-288 "Reference to Microsoft Word," version 3.0, pages 279-284
|
Additional reference words: macword macword5
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |