4D v14.3

GET PRINT OPTION

Home

 
4D v14.3
GET PRINT OPTION

GET PRINT OPTION 


 

GET PRINT OPTION ( option ; value1 {; value2} ) 
Parameter Type   Description
option  Longint, String in Option number or PDF option code
value1  Longint, String in Value 1 of the option
value2  Longint in Value 2 of the option

The GET PRINT OPTION command returns the current value(s) of a print option.

The option parameter enables you to specify the option to get. You can either one of the following predefined constants, located in the “Print Options” theme (longint), or a PDF option code (string).

The option constants are the following:

Constant Type Value
Paper option Longint 1
Orientation option Longint 2
Scale option Longint 3
Number of copies option Longint 4
Paper source option Longint 5
Color option Longint 8
Destination option Longint 9
Double sided option Longint 11
Spooler document name option Longint 12
Mac spool file format option Longint 13
Hide printing progress option Longint 14

A PDF option code consists of two parts, OptionType and OptionName, combined together as "OptionType:OptionName".

The command returns, in the value1 and (optionally) value2 parameters, the current value(s) of the specified option.

For more information on options, PDF option codes and possible values, refer to the description of the SET PRINT OPTION command.

Note the following specific features of the GET PRINT OPTION command:

  • option = 1 (paper option): returns the name of the current paper in value1 if value2 is omitted. If value2 is passed, the command returns, respectively, the width and height of the paper in value1 and value2. Use the PRINT OPTION VALUES command to get the name, height and width of all the paper formats offered by the printer.
  • option = 2 (orientation option): returns 1 (Portrait) or 2 (Landscape). If a different orientation option is used, value1 is set to 0. 
  • option = 5 (paper source option): in value1, returns the index (in the array of trays returned by the PRINT OPTION VALUES command) of the paper tray used (value2 must be omitted).
    Note:
    This option can only be used under Windows.
  • option = 8 (color option): returns a code in value1 specifying the mode for handling color: 1=Black and white (monochrome), 2=Color.
    Note:
    This option can only be used under Windows.
  • option = 9 (destination option): if the current value is not in the predefined list, value1 contains -1 and the system variable OK is set to 1. If an error occurs, value1 and the system variable OK are set to 0. If value1 contains a predefined value different from 1 or 5, value2 contains the access path of the printed file. 
  • option = 11 (double sided option): returns 0 (Standard or Single-sided, default value) or 1 (Double-sided) in value1. If value1 equals 1, value2 may return one of the following values: 0=Left binding (default), 1=Top binding.
    Note:
    This option can only be used under Windows.
  • option = 12 (spooler document name option): returns the name of the current print document in value1, if it has been defined previously. Otherwise, an empty string is returned.
Note: The GET PRINT OPTION command only operates with PostScript printers.

The system variable OK is set to 1 if the command has been executed correctly; otherwise, it is set to 0.

 
PROPERTIES 

Product: 4D
Theme: Printing
Number: 734

The OK variable is changed by the commandMac OS specificWindows specific

 
HISTORY 

Modified: 4D 2004.3

 
SEE ALSO 

PRINT OPTION VALUES
SET PRINT OPTION

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Inherited from : GET PRINT OPTION ( 4D v11 SQL Release 6)