
![[Back to RiceInfo]](http://riceinfo.rice.edu/images/navbar.gif)
Printform is a CGI program which accepts input from a user via a World-Wide Web form and then returns it in HTML format suitable for printing from the user's web browser.
Printform is intended for applications which require the submission of paper forms. For paperless submission of forms by e-mail, see the companion yamform program.
Like yamform, printform allows the programs is that printform allows the designer of the form to control the format of the resulting printed report -- not just the input format but the output format as well. However, since the actual printing is done by the end user's web browser, there may be variation from browser to browser and printer to printer.
Attention non-Rice users: Please refrain from setting up forms on non-Rice servers which post to the installation of printform at Rice. If you wish, you may install the printform source at your site, although please note that it is entirely unsupported by Rice.
Sections of this page:
<form method=POST action="http://riceinfo.rice.edu/cgi-bin/printform">
<input name=outform type=hidden value="
Favorite color report
Name: $name
Favorite color: $color
">
Note that there is a limit of 1024 characters for the maximum length of
a hidden field. In order to specify an output form longer than 1024
characters, you may break it into several hidden fields named
outform1, outform2, outform3, etc. Example:
<input name=outform1 type=hidden value="
Great Big Report
Name: $name
Favorite color: $color
...
">
<input name=outform2 type=hidden value="
Favorite food: $food
Favorite drink: $drink
...
">
Note that the output format can contain the
names of other input fields which you define, each preceded by a dollar sign ($). The
values input by the user will be substituted for the names of these
fields before the printable report is returned.
In order to include HTML tags in your printable report, you will have to escape the less than (<), greater than (>), ampersand (&), and quote (") characters within your hidden fields them using ampersand entities. For example, to use the <h1> tag in your output format, you would specify it as:
<h1>Here is an example showing several tags:
<input name=outform1 type=hidden value="
<h1>Favorite Color Report</h1>
<strong>Name:</strong> $name
<strong>Favorite color:</strong> $color
...
">