Embedding PostScript printer commands in a Word document

Microsoft Office Word 2003

\p Group
Defines the drawing rectangle that the subsequent PostScript instructions operate on.

ShowCommands

PostScript drawing commands specified in a PRINT field operate only on the drawing rectangle that's defined by one of the group commands listed here.

page

Defines the drawing rectangle as the current page (default).

para
Defines the drawing rectangle as the paragraph that contains the PRINT field. The paragraph must be at least 1 inch tall for "para" to produce a result.
pic
Defines the drawing rectangle as the next picture after the PRINT field but before the end of the paragraph that contains the field.
Row
Defines the drawing rectangle as the current table row.
Cell
Defines the drawing rectangle as the current table cell.

Show"Dict" group command

Use the "dict" group command to create a PostScript group that contains definitions and procedures that will be carried out later on the same page. Don't use the "dict" command to draw. Microsoft Word doesn't provide "wp$" variables for "dict" groups, nor does it change the drawing origin, clipping, and axes.

Note  Because Word text and graphics are printed on the same PostScript page as your PostScript commands, don't use operators that reset the PostScript environment. Avoid the following operators when using PostScript with Word: banddevice, copypage, framedevice, grestoreall, initgraphics, initmatrix, nulldevice, renderbands, and showpage.

ShowVariables

Word also defines variables for use with the PostScript commands specified in a PRINT field. Values represented by the variables are in points, which is the standard PostScript unit.

ShowVariables for all groups

The following variables are available to all groups of PostScript commands.

wp$y
Specifies the drawing height of the page, paragraph, row, or cell that the PRINT field is located in, depending on the Group argument used. If the "\p pic" argument is used, "wp$y" refers to the drawing height of the next picture before the end of the paragraph that contains the PRINT field.
wp$x
Specifies the drawing width of the page, paragraph, row, or cell that the PRINT field is located in, depending on the Group argument used. If the "\p pic" argument is used, "wp$x" refers to the drawing width of the next picture before the end of the paragraph that contains the PRINT field.
wp$page
Specifies the current page number.
wp$fpage
Specifies the formatted page number (string).
wp$date
Specifies the current date (formatted).
wp$time
Specifies the current time (formatted).
wp$box
Specifies the path that contains the drawing rectangle.

ShowVariables for "page" and "para" groups

The following variables are available to both "page" and "para" groups.

wp$top
Specifies top margin (page); space before (paragraph).
wp$bottom
Specifies bottom margin (page); space after (paragraph).
wp$left
Specifies left margin (page); left indent (paragraph).
wp$right
Specifies right margin (page); right indent (paragraph).

The following variables are available to the "para" group only.

wp$first
Specifies first-line indent.
wp$style
Specifies style.

The following variables are available to the "page" group only.

wp$col
Specifies the number of columns on the page. The number can vary, depending on the section that the PostScript appears in.
wp$colx
Specifies the width of each column.
wp$colxb
Specifies the space between columns.
"Codes"
PostScript instructions. If the instructions contain more than one word, enclose them in quotation marks.

Notes

  • To print PostScript over text, click the Options command on the Tools menu, click the Print tab, and then select the Print PostScript over text check box.
  • For complete information about the PostScript programming language, see the PostScript Language Reference Manual and the PostScript Language Tutorial and Cookbook, both by Adobe Systems, Inc., and published by the Addison-Wesley Publishing Co., Inc.