TrPrint Manual

Petr Pajas


Table of Contents

1. Introduction
2. Usage
3. ImageMagick Extension
4. Limitations
5. Examples

1. Introduction

TrPrint is a command-line utility for printing selected FS-trees or exporting them to PostScript or EPS or (if ImageMagick toolkit is present on the system) to other image formats.

2. Usage

trprint [-c config-file] [-r tree-selection] [-o output-file | -p output-command] [[-+][HTMSCENUI1]] input-file...
or
trprint [-u | -h]

There may be more than one input-file specified on the command-line. Moreover, parameter options -r, -p and -o as well as all flags ([+-][HTMSCENUI1]) may be inter-mixed with the input file-names in which case they only apply to the filenames that follow them.

Parameters options

-c

Use this parameter to force TrPrint to use certain configuration file. If omitted, standard configuration file of TrEd is used.

-r

This option may be used to select some trees of the input-files. If ommited, all trees are printed or exported. Parameter tree-selection is a comma-separated list of numbers or ranges of numbers, that correspond to the desired trees or tree-ranges. First tree in the file has number 1, second has number 2, etc. Ranges are pairs of numbers like 3-20 which in this case for instance covers all trees starting from the tree no. 3 to no. 20. If the first number in the range is omitted, 1 is assumed. If the second number in the range is ommited, the number of the last tree in the active file is assumed.

Example:

To print trees from 1 to 5, then trees no. 7, 11, 12, use e.g. one of the following selections:
1-5,7,11,12
1-5,7,11-12
-5,7,11-12

-o

Use this option to specify output filename. If more than one output file is to be created, the filename given is used as a pattern for the output file names. In such case, an integer number is inserted between the filename and extension part of the given pattern. The number used is either an ordinal number of the output file or tree number if -N flag is given. If -I flag is used, the filename extension indicates the output format.

-p

This parameter causes TrPrint to run the given command and pipe the output to it each time when otherwise an output file would be created.

Every flag may take two forms: positive -flag or negative +flag. (Think of +flag as of crossed -flag). The negative form of a flag has the opposite meaning to its positive form.

Flags

-H

Include hidden nodes.

-T

Use PostScript Type1 font for better kerning.

-M

Maximize tree size (span the tree across the page).

-S

Print the 'sentence' and file-name below the tree.

-C

Create color output.

-1

Print each tree to a separate output file. (See parameter -o for more detail on output files naming.)

-E

Create Encapsulated PostScript output. (Implies -1).

-N

Use tree numbers for labeling the of output files. (Implies -1).

-U

Insert underscore before output file number suffix.

-I

Enable ImageMagick output filter (Implies -E and -1). (See Section 3. below).

3. ImageMagick Extension

ImageMagick is a robust collection of tools and libraries to read, write, and manipulate an image in many image formats. TrPrint allows you to utilize the conversion tool of the ImageMagick package and thus to create output in any format supported by ImageMagick, including the popular ones like TIFF, JPEG, PNG, PDF, PhotoCD, and GIF. This package is part of most Linux distributions, but version for Microsoft Windows™ exists as well. On Windows platform the GhostScript is also needed.

To use this extension, ImageMagick must be installed on the system and its convert utility must be installed either somewhere in PATH or ImageMagickConvert configuration option must be set to point to it.

The output format is specified via the filename extension of the output filename (parameter -o).

4. Limitations

TrPrint uses Tk library for creation of the core postscript output. Therefore, on UNIX platform, X server must be running for this program to work. The running X server display may be specified via the standard --display DISPLAY Xlib option.

5. Examples

To print trees no. 1 to 7 and tree no. 14 of myfile.fs on the default UNIX printer, use the following syntax:

trprint -T -r1-7,14 -p lpr myfile.fs

The following, more complex example converts trees no. 3 and 5 of myfile.fs to GIF using the ImageMagick extension. Files tree.gif and tree_5.gif are created and hidden nodes are included in tree no. 3 but are excluded from tree no. 5 and tree no. 5 uses colours.

trprint -TN -o tree.gif -r3 -H myfile.fs -r5 +H -CU myfile.fs