Microsoft KB Archive/49310

Creating Line Numbers and Vertical Lines in PostScript

PSS ID Number: Q49310 Article last modified on 03-07-1997

=
========================================================= 3.00 3.01 3.02 4.00 5.00 5.10 MACINTOSH kbprint kbusage

= SUMMARY =

To create a document in Microsoft Word for the Macintosh that has line numbers printed down the left side that are separated from the body of the text by two vertical lines (such as a legal document), follow the appropriate procedure below.

Word Version 5.0 and 5.1
Word 5.0 includes the PostScript code necessary to create these line numbers in the Page Layout Glossary. To use the glossary entry in Word 5.0, do the following:


 * 1) From the Edit menu, choose Glossary.
 * 2) From the File menu, choose Open.
 * 3) Open the Glossaries folder and locate the Page Layout Glossary.
 * 4) Click the Open button.
 * 5) Find the “Pleading Paper/Line Numbers” glossary entry and insert it into the header.

Note: For an explanation of the PostScript commands in this glossary entry, see the “More Information” section of this article.

The left margin of the document must be at least 1.25 inches wide to allow room for the line numbers; otherwise, the line numbers are printed on top of the text. The margin can be changed in the File Page Setup dialog box.

Make sure that the Print Hidden Text option is not selected in the File Print dialog box when printing.

Word Versions 4.0 and 3.0x
For a Word versions 3.x or 4.0 document, type the following PostScript code into the header of the document and format it in the PostScript style:

%print numbers at left of page /Courier findfont 12 scalefont setfont /LM 72 def /Top 720 def /LineSpace 24 def /Temp 2 string def /NewLine {currentpoint LineSpace sub exch pop LM exch moveto} def LM Top moveto 1 1 28 {Temp cvs show NewLine} for

%print two vertical lines between line numbers and text .5 setlinewidth 96 0 moveto 0 792 rlineto 99 0 moveto 0 792 rlineto stroke

The left margin of the document must be at least 1.25 inches wide to allow room for the line numbers; otherwise, the line numbers are printed on top of the text. The margin can be changed in the File Page Setup dialog box.

Make sure that the Print Hidden Text option is not selected in the File Print dialog box when printing.

= MORE INFORMATION =

The following is an explanation of each line in the PostScript code above:

/Courier findfont 12 scalefont setfont
Selects the font to be used to print the line numbers (Courier) and the size (12). The line numbers and size are modified accordingly.

/LM 72 def
Sets the left margin for the line numbers. PostScript measures distances in points from the lower-left corner of the page, and there are 72 points per inch; therefore, this statement sets a 1-inch left margin.

/Top 720 def
Sets the vertical starting position for the first line number, measuring from the bottom of the page, in this case, 10 inches.

/LineSpace 24 def
Sets the line spacing between line numbers. When using a 12-point font size, 24 is equivalent to double-spacing.

/Temp 2 string def
Uses a temporary variable when printing the line numbers.

/NewLine {currentpoint LineSpace sub exch pop LM exch moveto} def
Moves the cursor to the beginning of the next line after a line number has been printed.

LM Top moveto
Moves the cursor to the starting point for the first line number.

1 1 28 {Temp cvs show NewLine} for
The main loop that prints the numbers. The loop starts at the first number (1) and ends at the third number (28), incrementing each time through by the second number (1). Changing the third number changes the last number to be printed.

.5 setlinewidth
Sets the line width to be half a point (1/144 inch).

96 0 moveto
Sets the starting point for the first line. The first number is the x-value measured from the left side of the page, the second number is the y-value measured from the bottom of the page.

0 792 rlineto
Creates the path for the first line, moving relative to starting point. In this case, it moves 0 points in the x-direction, and moves 792 points (11 inches) in the y-direction.

99 0 moveto
Sets the starting point for the second line.

0 792 rlineto
Creates the path for the second line.

stroke
Paints the lines according to the paths that have been defined.

KBCategory: kbprint kbusage KBSubCategory: kbformat Additional reference words: 3.00 3.01 3.02 4.00 5.00 3.0 4.0 5.0 macword macword5 macword5 ====================================================================== ============================================================================= Copyright Microsoft Corporation 1997.