Microsoft KB Archive/95724

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a

-

SUMMARY
To print from the Command window to a Hewlett-Packard (HP) LaserJet IIISi printer in PostScript mode when the printer's default setting is PCL mode, you must perform the procedure below before using the ? command.

MORE INFORMATION
Before running the code, make sure that the printer is configured for AUTO CONT=ON *. This can be accomplished from the printer's control panel as follows:


 * 1) Press the ON LINE key to take the printer off line. The indicator light should turn off.
 * 2) Hold the MENU key down for about 5 seconds. The message PCL CONFIG MENU should appear first, followed by SYS=HP-PCL *.
 * 3) Repeatedly press the MENU key until AUTO CONT=OFF * appears. If it is already set to ON, skip to step 6.
 * 4) Press the + key. AUTO-CONT=ON should appear.
 * 5) Press the ENTER key to save your choice. AUTO CONT=ON * should appear.
 * 6) Press the RESET key, then the ON LINE key.

The printer is now set for automatic switching from PCL mode to PostScript mode.

The following code must be run to automatically switch the printer from PCL mode to PostScript mode:   SET TALK OFF ** talk is directed to the screen SET PDSETUP TO &quot;postscript&quot; ** loads the printer driver setup SET LIBRARY TO c:\foxpro2\goodies\pdrivers\psapi.plb ** specifies external library SET PRINTER TO     ** specifies printer's default port SET PRINT ON     ** enables printing

x=set(&quot;pdset&quot;) ** initializes memory variable &quot;x&quot; SET PDSETUP TO     ** unloads printer driver DO PS     ** procedure call to switch printer ? pddocst(_plength, 128) ** loads PS code to start printing SET PDSETUP TO (x) ** loads driver to memory variable x&quot;

? &quot;this is a test of HPLJ IIISi PostScript&quot; ** test sentence to print

SET PDSETUP TO     ** unloads printer driver ?pddocend ** loads code to terminate print job DO PCL ** procedure call to switch printer back to PCL mode SET PRINT OFF ** disables output to the printer SET PRINTER TO     ** sets printer port to default SET LIBRARY TO     ** resets to default

*** Procedure to send printer escape sequence to switch to  *** PostScript

PROCEDURE PS  ??? CHR(27)+'%-12345X@PJL enter language=postscript'

*** Procedure to send printer escape sequence to switch to PCL

PROCEDURE PCL ??? CHR(27)+'%-12345X@PJL enter language=pcl'

***End of Program Code *** When you are printing in PostScript mode, the left margin will occasionally need to be adjusted to enable the first few characters to print in full. Adjust the left margin in the PostScript printer driver setup dialog box by choosing Printer Setup from the File menu. Additional query words: FoxDos Post Script III Si pdparms

Keywords         : Version          : Platform         : Issue type       :
 * }