File pscript.icn

Summary

###########################################################################

	File:     pscript.icn

	Subject:  Procedure for explicitly writing PostScript

	Author:   Gregg M. Townsend

	Date:     August 14, 1996

###########################################################################

   This file is in the public domain.

###########################################################################

	epsheader(f, x, y, w, h, flags) writes an Encapsulated PostScript
	file header and initializes the PostScript coordinate system.

###########################################################################

  This file is intended to contain procedures for writing PostScript
  output explicitly, as contrasted with the procedures in psrecord.icn
  that write PostScript as a side effect of normal graphics calls.
  There is only one procedure at present.

  epsheader(f, x, y, w, h, flags) aids the creation of an Encapsulated
  PostScript file by writing a header.  An EPS file can either be
  incorporated as part of a larger document or sent directly to a
  PostScript printer.

  Epsheader() writes the first portion of the PostScript output to file
  f; the calling program then generates the rest.  It is the caller's
  responsibility to ensure that the rest of the file conforms to the
  requirements for EPS files as documented in the PostScript Reference
  Manual, second edition.

  (x,y,w,h) specify the range of coordinates that are to be used in the
  generated PostScript code.  Epsheader() generates PostScript commands
  that center this region on the page and clip anything outside it.

  If the flags string contains the letter "r" and abs(w) > abs(h), the
  coordinate system is rotated to place the region in "landscape" mode.

  The generated header also defines an "inch" operator that can be used
  for absolute measurements as shown in the example below.
 
  Usage example:

	f := open(filename, "w") | stop("can't open ", filename)
	epsheader(f, x, y, w, h)
	write(f, ".07 inch setlinewidth")
	write(f, x1, " ", y1, " moveto ", x2, " ", y2, " lineto stroke")
	   ...
	write(f, "showpage")

###########################################################################
Procedures:
epsheader

This file is part of the (main) package.

Source code.

Details
Procedures:

epsheader(f, x, y, w, h, flags)

: write PostScript header



This page produced by UniDoc on 2021/04/15 @ 23:59:54.