[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

# 13. Generating Hardcopies

A variety of tools are available that can be used to turn your carefully constructed (and hopefully pleasing) user interfaces into printed hardcopies or something appropriate for inclusion in your program document. Most of these involves saving a snapshot of your interface on the screen into a file. Then this file is translated into something that a printer can understand, such as `PostScript`.

Another approach is to design the printing capabilities into the objects themselves so the GUI is somewhat output device independent in that it can render to different devices and X or the printer is just one of the devices. While this approach works better than screen snapshot, in general, it bloats the library unnecessarily. It is our observation that most of the time when a hardcopy of the interface is desired, it is for use in the application documentation. Thus we believe that there are ways to meet the needs of wanting hardcopies without bloating the library. Of course, some object classes, such as xyplot, charts and possibly canvas (if vector graphics), that are dynamic in nature, probably should have some hardcopy output support in the library, but even then, the relevant code should only be loaded when these specific support is actually used. This fattening problem is becoming less troublesome as computers get faster and typically have more RAMs nowadays.

`fd2ps` was designed to address the need of having a hardcopy of the interface for application documentation development. Basically, `fd2ps` is a translator that translates the Form Designer output directly into `PostScript` or `Encapsulated PostScript` in full vector graphics. The result is a small, maybe even editable, `PostScript` file that you can print on a printer or include into other documents.

The translation can be done in two ways. One way is to simply give the Form Designer the command line option `-ps` to have it output `PostScript` directly. or you can run `fd2ps` stand alone using the command

    fd2ps fdfile

where `fdfile` is the Form Designer output with or without the `.fd` extension. The output is written into a file named ``fdfile.ps`'.

`fd2ps` accepts the following command line options when run as a stand-alone program

`-h`

  This option prints a brief help message.

`-p`

  This option requests Portrait output. By default, the orientation is switched to landscape automatically if the output would not fit on the page. This option overrides the default.

`-l`

  This option requests landscape orientation.

`-gray`

  This option requests all colors be converted to gray levels. By default, `fd2ps` outputs colors as specified in the `.fd` file.

`-bw width`

  This option specifies the object border width. By default, the border width specified in the `.fd` file is used.

`-dpi res`

  This option specifies the screen resolution on which the user interface was designed. You can use this flag to enlarge or shrink the designed size by giving a DPI value smaller or larger than the actual screen resolution. The default DPI is 85. If the `.fd` file is specified in device independent unit (point, mm etc), this flag has no effect. Also this flag does not change text size.

`-G gamma`

  This option specifies a value (gamma) that will be used to adjust the builtin colors. The larger the value the brighter the colors. The default gamma is 1.

`-rgb file`

  The option specifies the path to the colorname database ``rgb.txt`'. (It is used in parsing the colornames in XPM file). The default is ``/usr/lib/X11/rgb.txt`'. The environment variable `RGBFile` can be used to change this default.

`-pw width`

  This option changes the paper width used to center the GUI on a printed page. By default the width is that of US Letter (i.e., 8.5 inches) unless the environment variable `PAPER` is defined.

`-ph height`

  This option changes the paper height used to center the output on the printed page. The default height is that of US Letter (i.e., 11 inches) unless the environment variable `PAPER` is defined.

`-paper format`

  This option specifies one of the standard paper names (thus setting the paper width and height simultaneously). The current understood paper formats are

  Letter

    8.5 x 11 inch.

  Legal

    8.5 x 14 inch

  A4

    210 x 295mm

  B4

    257 x 364mm

  B5

    18 x 20 cm

  B

    11 x 17 inch

  Note

    4 x 5inch

  The `fd2ps` program understands the environment variable `PAPER`, which should be one of the above paper names.

[ << ] | [ >> ] |  |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Jens Thoms Toerring on January 5, 2014 using texi2html 1.82.