Creating a Printer Driver Setup User Procedure

Last reviewed: April 18, 1995
Article ID: Q114130
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b, and 2.6

SUMMARY

The User Procedure option of the Printer Driver Setup dialog box allows additional control over printed output without changing the GENPD.APP printer driver program code. This article supplements the documentation on this option found in the FoxPro for MS-DOS "Developer's Guide" by providing an example of its usage.

MORE INFORMATION

The following steps demonstrate how to add a printer command to set a right margin of 50 for use with an HP LaserJet III.

Create the User Procedure program, named MARGIN50.PRG, as follows:

   * M A R G I N 5 0 . P R G  Printer Driver Setup User Procedure
   *
   * This program uses the first parameter passed to it from PDDOCST
   * routine found in the GENPD.APP driver program
   *
   PARAMETER parm1
   RETURN parm1 + CHR(27) + "&a50M"

To link the procedure with the printer driver setup, do the following:

  1. From the File menu, choose Printer Setup (or choose Layout from the Report menu if you are in a report).

  2. Select the Printer Driver Setup check box.

  3. Choose New to create a new setup or choose Edit to edit an existing driver setup.

  4. In the Printer Driver Setup dialog box, select the options you want, and then select the User Procedures check box.

  5. Select the Document check box in the Start section to bring up the file selection popup.

  6. Select the MARGIN50.PRG file.


Additional reference words: FoxDos escape codes pddocst pddocend pdpagest
pdpageend pdlinest pdlineend pdobjst pdobjend pdobject genpd 2.00
2.50 2.50a 2.50b 2.60
KBCategory: kbprint kbsetup kbprg
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.