The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

print.btred

Print trees according to given printing options.

USAGE

btred -qm print.btred -j '*' [<btred-options>] -o <print-options> -- <file(s)>

DESCRIPTION

This script similar functionality as the Print dialog in TrEd.

By default the script creates an A4 PDF file consisting of all trees of the current file.

The resulting files are named based on the input filename using the usual btred file-renaming flags (-r, -s, -p, -a). Unless -a flag is given to btred, the extension '.format' (where format is the lowercase name of the output format) is used (e.g. '.pdf' or '.eps').

The default behavior can be changed by many options.

IMPORTANT

  • The script uses Tk which on UNIX, requires that the DISPLAY environment variable is set and points to a running X server.

  • All options must always be given in pairs of the form --name value.

  • On the btred command line, the print options go between -o and --.

--out-dir directory

Save all resulting files to a given directory.

--quiet 1|0

Be more quiet.

--context context

Context to use for drawing trees (node_style_hook, root_style_hook, and possibly other hooks are called from this context).

--stylesheet stylesheet

Name of the stylesheet to use.

--stylesheet-paths path(s)

A colon- (semicolon- or Windows) separated list of paths to look for stylesheet files.

--range range

Lists trees to be printed (e.g. 5,-3,9-12,15- prints trees 5,1,2,3,9,10,11,12,15,16,...). Use . (dot) as range to print only the current tree from each file (i.e. the tree specified using tree-number suffix of the file URL).

--command command

System command to send the output to (e.g. lpr to print on the default printer on UNIX platform).

--toFile 1|0

If set to 1, the output is saved to a file specified in --filename.

--filename filename

Output filename (only when printing to file). This option is useful only when printing a single file.

If converting several files, it is recommended to use btred options --strip-prefix, --add-prefix, --strip-suffix, --add-suffix which this script obeys.

--format PS|PDF|SVG|EPS|ImageMagick

Target format. Default is PDF.

--noRotate 1|0

If 1, disables automatic landscape rotation of trees which are wider than taller.

--sentenceInfo 1|0

If set to 1, this command prints also the text associated with the tree.

--fileInfo 1|0

If set to 1, this command prints the filename and tree number below each tree.

--imageMagickResolution density

This value is passed to the command convert of the ImageMagick toolkit as --density. It specifies the horizontal and vertical resolution in pixels of the image.

--colors 1|0

Set to 1 for colour output. Default is 1.

--hidden 1|0

Set to 1 to print hidden nodes.

--psFontFile font.pfa

Specifies the PostScript font file to be used instead of the default one.

---psFontAFMFile font.afm

Specifies the PostScript ASCII metric font file to be used instead of the default one.

--ttFont font.ttf

Specifies the TrueType font file to be used when printing via PDF.

--fontSize size

Font size.

--fmtWidth width

Page width.

--fmtHeight height

Page height.

--hMargin dimension

The size of the left and right horizontal margins.

--vMargin dimension

The size of the top and bottom margins.

--maximize 1|0

Expand small trees to fit the whole page size. (Shrinking is done automatically).

--psMedia media

Specifies target given media size (used for PostScript, PDF, and SVG). Possible values:

User (dimensions specified in --fmtHeight and --fmtWidth), BBox (bounding box of the tree with only --hMargin and --vMargin added), Letter, LetterSmall, Legal, Statement, Tabloid, Ledger, Folio, Quarto, Executive, A0, A1, A2, A3, A4, A4Small, A5, A6, A7, A8, A9, A10, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, ISOB0, ISOB1, ISOB2, ISOB3, ISOB4, ISOB5, ISOB6, ISOB7, ISOB8, ISOB9, ISOB10, C0, C1, C2, C3, C4, C5, C6, C7, 7x9, 9x11, 9x12, 10x13, 10x14

BTRED OPTIONS

The following options of btred can be useful:

--strip-prefix|-p regexp

Remove strings matching a given regexp from the beginning of filenames before saving.

--add-prefix|-r prefix

Prepend output filenames with a given prefix.

--strip-suffix|-s regexp

Strip strings matching a given regexp from the end of filenames.

--add-suffix|-a suffix

Append a given suffix to the filenames.

LICENSE

This software is distributed under GPL - The General Public Licence. Full text of the GPL can be found in the LICENSE file distributed with this program and also on-line at http://www.gnu.org/copyleft/gpl.html.

AUTHOR

Petr Pajas <pajas@matfyz.cz>

Copyright 2007 Petr Pajas, All rights reserved.