Groff Options
On the printer setup screen:
System -> Setup -> Parameters -> Hardware -> CodesThe last option deals with how the system should process groff documents (used in definition files and History reports). You should set this to emulate the features of the printer.
The best option is to use 'Postscript' if your printer supports it.
In the options below we list the 'behind the scenes' commands that are run for reference. Within the commands there are some options that are added at run-time, they are:
| %% | The Name of the file being processed |
|---|---|
| %c | The Number of copies to print |
| %p | The Name of the Unix printer |
Option 0 - Laserjet
The LaserJet emulation will work for most forms on most HP LaserJet compatible printers. It will not however handle forms where there are embedded images - if this is the case it will switch over to using Option 4 with laserjet being the default.
This option will support the .DUPLEX command to allow the printer to print on both sides of the paper.
groff -P -pa4 -t -ma4 -mm -Tlj4 %% |
lp -n %c -cs -o raw %p
Option 1 - Deskjet
This is for the older DeskJet printers - for the newer DeskJet printers you should use the HPijs option. There are no options to change the default device being used.
groff -P -pa4 -t -ma4 -mm -Tps %% |
gs -q -sPAPERSIZE=a4 -sDEVICE=deskjet -r300 -dNOPAUSE \
-sOutputFile=- - -c quit |
lp -n %c -cs -o raw %p
Option 2 - Ascii
The most basic of options - print quality very very low as the driver will 'try' to make the page look nice by using basic formatting.
Not Recommended for anything other than a Dot matrix Printer
GROFF_NO_SGR=1 groff -ma4 -mm -t -Tascii -p %% |
lp -n %c -cs -o raw %p
Option 3 - PostScript
The basic workhorse - will work in all situations.
groff -P -pa4 -t -ma4 -mm -Tps %% |
lp -n %c -cs -o raw %p
Option 4 - Params.txt
This is similar to the DeskJet option above except you can change the
device being used. By default, it is, laserjet but by using the
params.txt entry GS_Device_X (where X is the printer
letter in the range A-Z) it can be allocated to any of the supported devices.
The current list of supported devices are:
bbox bit bitcmyk bitrgb bj10e bj200 bjc600 bjc800 bmp16 bmp16m bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 cdeskjet cdj550 cdjcolor cdjmono cljet5 cljet5c deskjet devicen djet500 epswrite faxg3 faxg32d faxg4 ijs jpeg jpeggray laserjet lj5gray lj5mono ljet2p ljet3 ljet3d ljet4 ljet4d ljetplus nullpage pbm pbmraw pcx16 pcx24b pcx256 pcxcmyk pcxgray pcxmono pdfwrite pgm pgmraw pgnm pgnmraw pj pjxl pjxl300 pkm pkmraw pksm pksmraw png16 png16m png256 pngalpha pnggray pngmono pnm pnmraw ppm ppmraw psdcmyk psdrgb psgray psmono psrgb pswrite pxlcolor pxlmono spotcmyk tiff12nc tiff24nc tiff32nc tiffcrle tiffg3 tiffg32d tiffg4 tiffgray tifflzw tiffpack tiffsep uniprint x11 x11alpha x11cmyk x11gray2 x11gray4 x11mono xcf
It can be a little 'trial and error' if you have one of the more obscure printers out there.
- The default XXXXX device is laserjet
- It can be changed with the params.txt entry GS_Device_{Printer}
groff -P -pa4 -t -ma4 -mm -Tps %% |
gs -q -sPAPERSIZE=a4 -sDEVICE=XXXXX -dNOPAUSE -sOutputFile=- - -c quit |
lp -n %c -cs -o raw %p
Option 5 - Output to File
There may be a need to capture a form or document for inclusion in another. This option will generate a PNG file in the tmp folder that you can manipulate as needed.
groff -P -pa4 -t -ma4 -mm -Tps %% | gs -q -sPAPERSIZE=a4 -sDEVICE=pngmono -dNOPAUSE -sOutputFile=- - -c quit | cat >/tmp/XXXX.png
Option 6 - HPijs
HPijs is software specifically for the HP range of printers. For a list of the supported printers and the Model name please refer to:
http://hpinkjet.sourceforge.net/printmodedescr.php
Note: This does not work with Samba connected printers.
- XXXXX for the DeviceModel is by default HP LaserJet
- Change with params.txt entry: HPijs_{Printer}
groff -P -pa4 -t -ma4 -mm -Tps %% |
gs -q -sPAPERSIZE=a4 -sDEVICE=ijs -sIjsServer=hpijs \
-sDeviceManufacturer="HEWLETT-PACKARD" \
-sDeviceModel="XXXXX" -dIjsUseOutputFD' -dNOPAUSE \
-sOutputFile=- - -c quit |
lp -n %c -cs -o raw %p