Printing

The function PrintCanvas is in the file print.c . It prints out the contents of the plot window, and all four of its borders in postscript format.

It is very easy in Tcl/Tk to dump out a postscript file of a canvas. The trick here was to combine five postscript files from five canvases (plot window and four borders) into one postscript file.

The way this is accomplished is, perhaps, not too elegant, but it does work. A brief outline of the algorithm is given below.

First the five canvases are dumped into five seperate postscript files. The file names are:

Next, the five files are concatenated together and stored in a new file called Then, a new file is created which will hold the contents of the above file modified so that it is printed together in one integrated page.

The input file (.ipl.total.ps) is scanned line by line, searching for keywords or phrases and replaces them with hard coded information.

These changes include.

Note in the code you will see the input being compared to something like %%BoundingBox and be replaced with %%%%BoudingBox. This is because % is a special character in C and requires printing %% to actually print %.

Finally, the file .ipl.iplot.ps is sent off to the default printer. If the user wishes to print to a printer other than the default one, the easiest way is to just go to the UNIX command line. The file will not be erased, although it will be replaced by the next printing.


IPlot Home Page Technical Doc's User's Guide
IPlot and its accompanying WWW pages were written by Gene McKenna
a member of Stanford University's famous TCAD Group