man print.ini (Formats) - survex printer settings

NAME

print.ini - survex printer settings

Description

The print.ini file contains printer descriptions for the Survex printer drivers.

File Format

The format of the print.ini file is similar to the .ini files used on Microsoft Windows. The file is divided into sections, each section corresponding to a separate printer description. A section starts with a section name in square brackets, e.g.:

[generic_pcl] 

followed by some options of the form <option>=<setting>, e.g.:

pixels_across_page=960 

Most options are preceded by a comment (indicated by a semicolon ';') briefly explaining the option.

Each section can contain a 'like' option. If present this contains the name of another section (possibly in another print.ini file). Options not specified in the current section will be taken from that section. This allows a printer definition to be based on that for another similar model of printer.

Here is an example of how this works:

[dm_9pin_12inch] 
like=dm_11inch_9pin 
lines_down_page=108 

This says that the definition 'dm_9pin_12inch' (for a 9pin dot matrix printer using 12 inch paper), is just like the 11 inch definition for the same printer, except that there are more lines per page.

Each printer driver reads a different section - printdm (the Dot Matrix driver) reads:

[dm] 
printhpgl (for HPGL plotters) reads:

[hpgl] 
printpcl (for PCL printers) reads:

[pcl] 
printps (for Postscript printers) reads:

[ps] 
Several definitions are supplied for each printer driver, covering most commonly encountered printers of each type.

printdm

The definitions provided for printdm are: dm_8pin_a4, dm_8pin_11inch, dm_8pin_12inch, dm_9pin_a4, dm_9pin_11inch, dm_9pin_12inch, dm_24pin_a4, dm_24pin_11inch, dm_24pin_12inch, dm_panasonic_24pin, dm_lx86_9pin_11inch, and bj (for driving Canon BJ printers).

In the unlikely event that you need to change the printer control codes, here is a quick overview of the format: printable characters are literal, except for backslash. A backslash '' indicates that the following character or characters are to be interpreted as a control code, as follows: followed by an 'x' followed by two hex digits represents the character with that hex value; a double backslash means a literal backslash; 0 is nul (0); t is tab (9); n is newline (10); r is return (13); [ is escape (27); ? is delete (127); A - Z are (1) to (26).

This is all rather cryptic (printer codes inherently are) but the provided set-ups will work with nearly all dot matrix printers, so you are unlikely to need to fiddle with these runes.

printhpgl

The definitions provided for printhpgl are: hpgl_generic_a4landscape, hpgl_generic_a1landscape, and hpgl_generic_a0landscape.

printpcl

The definitions provided for printpcl are: pcl_generic_a4 and pcl_modern_a4.

Note that if you are using a PCL printer the defaults are set not to use advanced printer features for compatibility. If you want to try these (equivalent to HP Laserjet III or later), then you should use the modern_pcl_a4 printer definition (see below for how to do this). This will enable horizontal and vertical tabbing.

printps

There's only one definition provided at present: ps_generic_a4.

Customising Printer Settings

The only settings most users will want to customise are which printer definition is used, and where to send the output. If you're using a Dot Matrix Printer you will also need to set calibration details.

You shouldn't modify the master print.ini (located in /usr/share/survex on Unix, or in the same directory as the Survex program files on other systems), or your changes will be overwritten by upgrades. Instead create:

•
/etc/survex/print.ini (Unix - system-wide settings)
•
~/.survex/print.ini (Unix - per user settings)
•
myprint.ini in the directory where Survex is installed (other platforms)

The drivers look for the section "[dm]", "[ps]", "[pcl]" or "[hpgl]" as appropriate. The file you create should should contain something like this to select a particular printer:

[pcl] 
like=pcl_modern_a4 

For printdm, it should also contain calibration measurements (calibrate your printer by running printdm --calibrate):

[dm] 
like=dm_24pin_a4 
mm_across_page=202 
mm_down_page=278 

You can override other settings too, such as the output destination. This is usually inherited from [base], and can be overridden in [base] (where it'll apply to all printer drivers) or in a printer driver specific section (such as [dm]). The output destination is set by an option of the form output_<platform>=<device>, where device can be a device name (e.g. PRN, LPT1, LPT2 under DOS, Printer: under RISC OS) or a filename:

[dm] 
output_msdos=LPT1 
like=dm_24pin_a4 
mm_across_page=202 
mm_down_page=278 

Under UNIX output may be piped into another command like so:

[base] 
; send output to printer 'oak' 
output_unix=|lpr -Poak 

Note you can also override the output setting using the --output command line option.

If the output device isn't a device or a pipe command, it is taken as a filename to write the printer data to. This can then be sent to a printer later.

Caution:

If you're using DOS you need to be careful when sending output to a file - printdm, printpcl and printhpgl all produce binary files, which must then be sent to the printer with COPY /B OUTPUT PRN where OUTPUT is the filename and PRN the device name. Do not use COPY without the /B. If you do, the output may be corrupted. Sorry, this is a deficiency of DOS, and there is nothing we can do about it.

If you send output straight to the printer, by putting PRN or LPT1 in the configuration file, then this problem should not occur.

printps produces text files as output, and so should be unaffected by this problem.

printdm can also drive Canon bubblejets in native mode (which gives a higher resolution than in Epson emulation mode). To use this, set "like=bj" in the "[dm]" section - like so:

[dm] 
like=bj 

See Also

printdm(1), printhpgl(1), printpcl(1), printps(1)