3. Alphabetical Listing of all Routines

choosePrinter

Description: This is essentially the same as getPrinter(). It asks the user to select a printer and returns a sequence identifying that printer. It is used here so that the returned value is stored within this module for later automatic reference.
This routine also works out the scaling factor of the printer in the X & Y directions.

See Also: finishPrinter, printPage



demoPrinter

Syntax: demoPrinter(bmp_filename)
Description: This is a demonstration routine; it uses most of the routines in grprint to print a single page of assorted text and graphics. It may be deleted if not required.



finishPrinter

Description: Prints any waiting page and releases the printer for others to use. It remembers that you have finished with the printer so that if choosePrinter() is called again it will once again ask which printer you want to use. You could choose the same or a new printer.



printDIB

Syntax: printDIB(x,y,w,h,filename)
Description: This routine prints a bitmap image in the box defined by the coordinate x,y and of size w,h. If w or h are zero, the image is printed such that its aspect ration is preserved. If both are 0, then the image is printed with its original width and height, in pixels.



printFilledPolygon

Syntax: printFilledPolygon({x1,y1,x2,y2,x3,y3...}, color)
Description: This is like printPolygon in that it defines a polygon with the series of coordinates x1,y1 to x2,y2 etc and xn,yn back to x1,y1, where xn,yn are the coordinates of the last point given. The polygon is then filled with the color given. No boundary line is drawn.
Care must be taken in the lines defining the border cross each other; some parts of the polygon will then have the color defined "twice" and this is likely to give no color. See the demo program output to see what I mean.
See Also: printPolygon, demoPrinter



printFilledRectangle

Syntax: printFilledRectangle(x1,y1,x2,y2,color)
Description: This is just like printRectangle (q.v.) but will draw it filled, in the color given. The color must be an atom as obtained from function rgb(). There is no outside line printed.
See Also: printRectangle



printLine

Syntax: printLine(x1,y1,x2,y2)
Description: This routine is the basic line-drawing routine from a first x,y to a second x,y
See Also: printThickLine



printPage

Syntax: printPage(flag)
Description: This routine completes the printing of the current page and starts a new page. It may end the document and/or start a new document. The argument is a flag with these values:
	0                  will end the page but that's all.
	PrintNow           will end the page and end the document.
	PrintANew          will end the page and start a new page.
	PrintNow+PrintANew will end the page and the document and start a new document and page. 
See Also: finishPrinter



printPolygon

Syntax: printPolygon({x1,y1,x2,y2,...}, width)
Description: This will print a polygon linking the pairs of coordinates given in the sequence of such coordinates. It will draw the last line from the last coordinate to the first. It will draw the polygon with a line of thickness given, in relevant units.
See Also: printFilledPolygon



printRectangle

Syntax: printRectangle(x1,y1,x2,y2,thickness)
Description: This routine draws a hollow orthogonal rectangle with its top-left corner at x1,y1, and its bottom-left corner at x2,y2. The lines are drawn with the thickness given.
See Also: printFilledRectangle, printPolygon, printFilledPolygon



printString

Syntax: printString(x,y,text)
Description: This is a more complex routine. It prints text in the font set by setPrinterFont, beginning at coordinate x,y. However, newline characters and horizontal tab characters are taken care of and even new pages are printed if the text would run off the end of the page. It could be used directly to print a long block of text such as read from a DOS text file.
When a newline is encountered, the printing start coordinate is moved to the same x-coordinate as the original x, and the y is incremented by the vertical size of the font chosen.



printTextCentral

Syntax: printTextCentral(x, y, text)
Description: This prints text centrally located about the point x,y. It prints in the font and attitude given in setPrinterFont().
See Also: printTextLeft, printTextRight



printTextLeft

Syntax: printTextLeft(x, y, text)
Description: This routine prints text with its left hand side at coordinate x,y.
See Also: printTextCentral, printTextRight



printTextRight

Syntax: printTextRight(x, y, text)
Description: This prints text such that its right hand side is at coordinate x,y.
See Also: printTextCentral, printTextLeft



printThickLine

Syntax: printThickLine(x1,y1,x2,y2,thickness)
Description: This is just like the printLine routine in that it draws a line from point x1,y1 to x2,y2. However, there is a fifth argument which defines the thickness of the line in units as set up. The routine caters for printers which are anisotropic - that is, that have a different number of pixels per unit distance in the x and the y directions, to give a line of consistent thickness - approximately!
See Also: printLine



setPrinterPenColor

Syntax: setPrinterPenColor(color)
Description: This sets the color the printer will use for its graphic drawing processes. The color is either an atom (as from the rgb(a,b,c) function, or a sequence {Red,Green,Blue}.
See Also: setPrinterTextColor



setPrinterTextColor

Description: This sets the color the printer will use for its text printing processes. The color is either an atom (as from the rgb(a,b,c) function, or a sequence {Red,Green,Blue}.
See Also: setPrinterPenColor



setPrinterUnits

Description: This defines what coordinate and width dimension units are. The possibilities are:

	PrintInch	Units in inches, line widths in thousandths 
PrintCm Units in centimetres and line widths in hundredths of centimetres
PrintMm Units in millimetres and line widths in tenths of millimetres

Other values set the units to be that proportion of the printer page WIDTH. Line widths are set at 1/1000 part of the units.