Prior to release 4.621 there was no way to specify a specific printer to use when printing to the DFPRINT print spooler, or to create a file that could be viewed in other applications. From 4.621 you can set up multiple instances of the DFPRINT device each mapped to a different Windows printer, either using a real device name or a logical name that is mapped to a real device using an environment variable or entry in the DP4 configuration file, and prefix the name with options that will cause output to be converted to formats usable by other applications, and/or (from 4.623) print multiple copies of a document.
To use this facility create a new POD based on DFPRINT and then select the Configure POD option. Instead of the normal configuration dialog, a simple dialog is displayed that allows you to enter the name of the Windows printer to be used is displayed. You can do any one of the following:
Leave the name blank to use the default printer.
Enter the name shown for the printer in Explorer to use another local printer.
Enter a printer name in the form \\server_name\printer to use a network printer.
Enter a name of the form %MY_PRINTER to get the printer name from the environment variable MY_PRINTER (which you must ensure is set up).
Enter a name of the form $printer to get the printer name from the value of a DP4 configuration file (DP4.INI) variable called "printer". This variable can be set separately for each program section.
It is also possible to prefix the printer name (if any) set up in the Configure POD dialog with one of four special strings that cause some modifications in the way DFPRINT behaves.
Each of the special strings may cause DFPRINT to convert the printed output to a file:
!0 creates one large web page with a .htm extension containing all the pages. Prior to 4.621 a .css file containing the stylesheet for the report is also generated, but from 4.621 the stylesheet is included in the .htm file.
!1 creates multiple .htm files each containing one page of the output. From 4.621 each .htm file contains all necessary style information.
!2 creates a .rtf file containing all the pages of the output encoded as a metafile. The file is suitable for display using Microsoft Word, or Microsoft Word Viewer, which is a free utility available from the Microsoft Web site. These .rtf files are not displayed correctly by some other applications, such as Wordpad, that rely on Rich Edit controls.
!3 also creates a .rtf file, but one which is compatible with applications that rely on Rich Edit controls. It should be noted that this type of file may be a lot larger than files created using !2, and also that not all aspects of the display are correct (though this is only likely to be a problem with controls that are not usually included in print-outs, such as buttons,icons and VCRs).
Whether or not the converted output file is actually created depends on how DFPRINT is invoked: if DFPRINT is invoked interactively, then the conversion only takes place if the user uses the Save option; if DFPRINT is invoked in batch mode, then the file will automatically be created unless the calling program specifies that output is only to be printed.
The 4.621 system database contains two new POD devices, Word_RTF_Meta and WordPad_RTF_Meta that create !2 and !3 files. Both these filetypes may be very useful for sending a report via e-mail:
It should be noted that the .RTF file-format is not space efficient, so you may choose to zip the files before sending them.
From 4.623 you can configure a DFPRINT device that will print multiple copies of a document. This is done in a similar way to the way in which the save format is set - you prefix the printer name (if any) with a special string: *nn where nn is a number denoting the number of copies of the document to be printed. For example to print two copies of each document specifiy *2 before the printer name.
Printing multiple copies of a document relies on the printer driver to support this feature. DFPRINT itself does not have logic for printing multiple copies of a document. Therefore, if you require this facility, you should check that the printer the system will be deployed with supports printing of multiple copies.
If DFPRINT is invoked in a way that allows the user to select whether or not to print, then when the user presses the Print button the print dialog that appears will have the number of copies to be printed set to the appropriate value, but the user will be able to over-ride this. However, if the print dialog is bypassed then the correct number of copies should be printed automatically.
From 4.621 you can also set or clear the "hidden device" property for individual DFPRINT devices. This is also done in the Configure POD dialog.