Create Postscript files by programming in Pascal !

Abstract

Pas4PS is an Object Pascal (Borland) library for programming PostScript pictures. Includes primitives for drawing polygons, arcs, arrows, dashing etc. Written basically to create relatively simple illustration for scientific papers. Can be used to plot custom-tailored graphs of functions, Poincare sections, and similar calculation-based graphics which may look better than analogous brandname-generated graphics.

In order to use this library in its present form, you need a Pascal compliler that supports Objects. The package was developed using the good old Borland 5.5 under DOS. If you know a compiler under UNIX (Linux) which is able to eat this program, please let me know. Of course this code can be translated, say, to C++.

How to use this library.

  1. Technology:
    1. Write a turbo-pascal program which uses ps_util, ps_geom;
    2. Compile it;
    3. Run it; it will create files you wished (in Postscript and, may be, TeX format)
    4. See ps-picture in ghostview or other PS viewer.
    5. Manually edit your TeX file (and may be PS file; in particular make sure that BoundingBox line is present, e.g.  %%BoundingBox 0 0 200 200 )
    6. TeX-process the TeX file.

  2. Components of the library:
    1. ps_util.pas   Open/close, output for TeX and PostScript files that a program may create. Simple procedures; mainly macrocommands or action nicknames.
    2. ps_geom.pas Main library for drawing in Postscript by programming in Pascal. Defines objects Point, PList, Matrix, AffineMatrix. Two types of operations are present for those objects: abstract (mathematical) operations, which don't do anything with output file(s), and drawing operations, which write certain lines to a Postscript file.
      Notice that whatever is contained in the Postscript file, nothing will be actually drawn until path closing command(s) like stroke or fill are present. In Pascal program, procedure show(.) is responsible for that.
      It is recommended that the user print out the interface part of this file for reference. The best way to learn how to use it is to look through supplied examples and to experiment changing their code.
    3. Additional utilities:
      DotShape.pas special dots (triangle, star,..)
      Arr_Curv.pas for putting arrows on curves
      EllArc.pas arcs of ellipses
      See comments in those files.

    Download the library and examples (24 Kb zipped)

    Sergey Sadov's home page
    Software page
    sergey@math.mun.ca