Creating HTML |
Top Previous Next |
Creating HTML
UnForm will create HTML output if you specify "-p html" on the command line. Given this parameter, and with no "-f rulefile" parameter, UnForm will look for the "html.rul" file rather than the default "unform.rul" file used for printer output.
By default, the HTML output is generated to standard output (on UNIX only), but it is normally preferable to specify an output file, such as "-o /usr/internet/docs/reports/aging". UnForm can then build the reports with varying styles in stages, and a browser can view interim results as soon as the first page is generated. UnForm will add a ".htm" extension automatically to the output file. UnForm will also create additional files depending on the style of the report. For example, if a table of contents is generated as a separate document, then the base file (aging.htm in the above example) will be the table of contents, and additional files will be generated for the pages of the report (aging.page.htm).
A sample command, therefore, might look like this:
unform -i aging.txt -o /usr/internet/docs/reports/aging -p html -f ourhtml.rul As HTML structure is very different from that of laser printers PCL, HTML rule sets are very different from printer rule sets. UnForm uses HTML table structures to format pages. These structures have a defined hierarchy of rows, cells, and data, with attributes applied to either cells or data. HTML rule sets follow this structure in that you define rows, then within rows you define cells, and then within cells you define the attributes of the cell and text.
The HTML output that UnForm produces can be in one of several styles. The rule set options used to trigger the style are shown in parentheses:
Note that all these options but the first require that a table of contents be maintained as each page is generated. In order to construct an updated document as each page is generated, UnForm must generate temporary files with which to build the HTML required. The filename specified by the "-o" option is re-created as each page is completed. Therefore, if standard output is generated rather than output files, only the first style can be produced.
This interim generation of files means that the HTML output can be viewed as soon as the first page is generated. This can be very helpful when large reports are being formatted in real-time. |