DynaWeb Publishers Guide
|5. Modifying The DynaWeb Interface|
|Modifying the Print Interface|
DynaWeb 4.1 supports the printing of DynaText books through the dwprint utility. Users can now select all or part of a DynaText book for printing, and DynaWeb will use the book's print stylesheet to create a PostScript file. The user then downloads the PostScript file through their browser and uses a PostScript reader to view or print the file.
The publisher can provide alternate print stylesheets, add or delete spoolers, or disable printing entirely if desired. This section provides an overview of the printing customizations available for DynaWeb 4.1.
The simplest way to disable printing is to remove the Print button from the button bar. See "Removing the Print Button" in this chapter for specific instructions.
DynaWeb allows users to choose from a list of common spoolers (such as A4, landscape, etc.) when printing their documents. These spoolers handle the formatting of the PostScript file. The default list of spoolers is:
These spooler names are taken from the config.dat file located in the data/ps directory under your DynaWeb installation.
You can modify an existing <SPOOLER> declaration from the config.dat file to suit your own needs. A typical <SPOOLER> declaration looks like:
<SPOOLER name=default width=612 height=792 command="lp"> <LANGMAP language=en charset=iso8859-1> <LANGMAP language=fr charset=iso8859-1> <LANGMAP language=it charset=iso8859-1> <LANGMAP language=de charset=iso8859-1> <LANGMAP language=es charset=iso8859-1> <LANGMAP language=ja charset=japanese-euc> </SPOOLER>
Find the <SPOOLER> declaration in the file data/ps/config.dat that corresponds to the spooler you wish to remove and remove the entire declaration.
DynaWeb uses a Tcl command called dwPrinters to determine the types of printers you have configured on the server machine. In order to add a printer to DynaWeb, you must configure it for usage on your server machine, and DynaWeb will automatically incorporate it into the list of available spoolers on server restart.
In DynaWeb's print interface, the user can select from a drop-down list of print views. Print views correspond to the print stylesheets available for the current book.
Note: DynaWeb assumes there is at least a fulltext.pv stylesheet available and always provides a "default" print view for printing. Printing without at least a fulltext.pv available may cause unusual behavior.
Adding a Print View
The list of available print views is built into the bookprnt.dwc configuration file. The section of the bookprnt.dwc file that creates the list looks like:
<SELECT> <OPTION VALUE="fulltext.pv">Default </SELECT>
The value of VALUE corresponds to the name of the print stylesheet, while the text following the OPTION tag is the text that will be displayed in the drop-down list.
For example, if we wanted to create another print view called Landscape that uses the landscape.pv print stylesheet, we would add a second OPTION tag with the new stylesheet name and our alias for the selection.
<SELECT> <OPTION VALUE=fulltext.pv>Default <OPTION VALUE=landscape.pv>Landscape </SELECT>
Removing a Print View
To delete an existing print view, simply find the correct line in data/config/bookprnt.dwc and remove the OPTION tag that corresponds to the view you wish to remove.
The print locale drop-down list passes a locale to the dwprint executable. dwPrint then assigns the encoding to the file it generates.
Adding a Print Locale
To add a print locale, find the correct section of the bookprnt.dwc file by searching for the string "NAME=locale". Then add an OPTION tag to the list. In the example below, we will add a new locale for American. The VALUE parameter must contain a supported value for the locale (C, ja, japanese, etc.). A list of supported locales can be found in the pls.map file located in the data directory under your DynaWeb installation.
<SELECT NAME=locale> <OPTION VALUE=C>English (iso8859 -1) <OPTION VALUE=C>French (iso8859 -1) <OPTION VALUE=C>Italian (iso8859 -1) <OPTION VALUE=C>German (iso8859 -1) <OPTION VALUE=C>Spanish (iso8859 -1) <OPTION VALUE=ja>Japanese (EUC) <OPTION VALUE=japanese>Japanese (SHIFT-JIS) </SELECT>
After adding new locale:
<SELECT NAME=locale> <OPTION VALUE=C>English (iso8859 -1) <OPTION VALUE=C>American (iso8859 -1) <OPTION VALUE=C>French (iso8859 -1) <OPTION VALUE=C>Italian (iso8859 -1) <OPTION VALUE=C>German (iso8859 -1) <OPTION VALUE=C>Spanish (iso8859 -1) <OPTION VALUE=ja>Japanese (EUC) <OPTION VALUE=japanese>Japanese (SHIFT-JIS) </SELECT>
Deleting a Print Locale
To delete a print locale, find the correct section of the bookprnt.dwc file by searching for the string "NAME=locale". Then delete the OPTION tag from the list.