Microsoft KB Archive/88579

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6x

-

SUMMARY
To use a printer driver in a FoxPro application, additional code is required. The text below provides examples of the necessary code.

MORE INFORMATION
NOTE: The following code may need to be modified to work with your specific printer.

PostScript Driver
The PostScript printer driver is unique because it is the only driver that parses the data it receives and adjusts the output for any special characters it receives. For example, when a left parenthesis (&quot;(&quot;) is printed with the PostScript driver, the driver adds a backslash character (\) to the data stream. For this reason, a printer driver must not be affected when the PDDOCST and PDDOCEND procedures make these changes. The value returned from these procedures is sent to the PDOBJECT procedure and evaluated.

The following code fragment demonstrates how to use a PostScript printer driver in an application:   SET TALK OFF *  * Set PDSETUP to any valid PostScript printer driver listed in the * FOXUSER database. SET PDSETUP TO &quot;PALATINO 10&quot; SET LIBRARY TO GOODIES\PDRIVERS\PSAPI.PLB *  * To print to a network printer, change the following command. SET PRINTER TO TEST.TXT SET PRINT ON  * * Save the printer driver setup and remove the printer driver. * Doing so prevents the PostScript printer driver from interpreting * the information in the page header. Afterwards, set the printer * driver back to its initial setting. *  X=SET(&quot;PDSETUP&quot;) SET PDSETUP TO  ?PDDOCST(_PLENGTH,128) SET PDSETUP TO (X)

? &quot;This is a test&quot;

*  * Return the printer driver to its initial setting. *  X=SET(&quot;PDSETUP&quot;) SET PDSETUP TO  ?PDDOCEND

SET PRINT OFF SET PRINTER TO  SET LIBRARY TO

Non-PostScript Printer
The following code fragment demonstrates how to use the Hewlett-Packard Printer Control Language (HP-PCL) printer driver in an application:   SET TALK OFF SET PDSETUP TO &quot;HP&quot; SET LIBRARY TO GOODIES\PDRIVERS\DRIVER2.PLB *  * To print to a network printer, change the following command. SET PRINTER TO TEST.TXT SET PRINT ON  PRINTJOB

? PDDOCST(_PLENGTH,128) ? &quot;This is a test&quot; ? PDDOCEND

ENDPRINTJOB SET PRINT OFF SET PRINTER TO  SET LIBRARY TO   SET PDSETUP TO &quot;HP&quot;

.PRG in GENPD.APP
NOTE: The following code may need to be modified to work with your specific printer.

When you are using _pdriver=&quot;driver.prg&quot; in GENPD.APP, use the following code:   SET TALK OFF SET PDSETUP TO &quot;HP&quot; SET PROCEDURE TO GOODIES\PDRIVERS\DRIVER.PRG NOTE: Instead of using SET LIBRARY TO, you use SET PROCEDURE TO. Additional query words: FoxDos 2.50 2.50a 2.50b 2.60 2.60a report

Keywords         : FxprintDriver Version          : 2.00 2.5x 2.6x Platform         : MS-DOS Issue type       :
 * }