Microsoft KB Archive/27082

PostScript Code for Box Around Page in Wide Orientation

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

=
========================================================= 3.00 3.01 3.02 4.00 MACINTOSH kbprint kbappnote

= SUMMARY =

Use the following steps in order to use the PostScript language to create a box around a page in wide orientation:

  Set the proper margins and orientation in Page Setup. Then, insert the following PostScript code into the page header: %page borders 36 36 moveto 0 540 rlineto 720 0 rlineto 0 -540 rlineto closepath stroke   Highlight this code and apply the PostScript style to it by pressing COMMAND+SHIFT+S, typing “postscript”, and pressing ENTER. 

The origin (0,0) in PostScript is in the lower-left corner of the page. The coordinates are in point units (each point is 1/72 inch). PostScript first creates a path; you then can choose the Stroke command. This path will be painted and it will be printed when Showpage is chosen.

= MORE INFORMATION =

The following is an explanation of the commands in the PostScript program above.


 * 1) In the command “% (text goes here)”, anything following a “%” (percent) sign is a comment and will be ignored by the PostScript interpreter. In this example, the comment is the test “page borders”.
 * 2) The command “x y moveto” will start at the origin (0,0) and move horizontally by “x” points, and vertically by “y” points. In this example, x is 36, y is 36.
 * 3) The command “x y rlineto” indicates relative lineto. This command will start at the current position, move horizontally, and add a line segment to the current path. A positive number indicates “to the right” for x and up for y; a negative number indicates “to the left” for x and “down” for y. In this example, the first “rlineto” has 0 for x, 540 for y.
 * 4) The command “closepath” adds a line segment to the current path connecting the current point to the last point addressed by a moveto operator. It gives a clean mitered corner.
 * 5) The command “stroke” will paint the path created by the other PostScript commands.

For more information on how to use PostScript with Word, obtain the application note titled “MW0316: Introduction to PostScript Using Microsoft Word.” For information about obtaining this application note, query on “MW0316” in the Microsoft Knowledge Base.

KBCategory: kbprint kbappnote KBSubCategory: Additional reference words: macword macword5

= ====================================================================== =

Copyright Microsoft Corporation 1997.