SET PRINT OPTION

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 2004.3 (Modified)


SET PRINT OPTION (option; value1{; value2})

ParameterTypeDescription
optionLongintOption number
value1Longint | StringValue 1 of the option
value2Longint | StringValue 2 of the option

Description

The SET PRINT OPTION command is used to modify, by programming, the value of a print option. Each option defined using this command is applied to the entire database and for the duration of the session as long as no other command that modifies print parameters (PRINT SETTINGS, PRINT SELECTION without the > parameter, etc.) is called.

The option parameter allows you to indicate the option to be modified. You can pass either a value or one of the predefined constants of the "Print options" theme.

Pass the new value(s) of the specified option in the value1 and (optionally) value2 parameters. The number and nature of the values to be passed depend on the type of option specified.

The following table lists the options and their possible values:

option (constant)value1value2
1 (Paper option)Name-
WidthHeight
2 (Orientation option)1=Portrait, 2=Landscape-
3 (Scale option)Number (%)-
4 (Number of copies option)Number-
5 (Paper source option)Windows only:
Index (number)-
8 (Color option)Windows only:
1=N/B, 2=Color-
9 (Destination option)1=Printer,-
2=File (PC)/PS (Mac), Access path
3=PDF (Mac),Access path
5=Screen (Mac)-
11 (Double sided option)Windows only:
0=Single-sided (standard)-
1=Double-sidedBinding: 0=Left (default), 1=Top
12 (Spooler document name option)Name of document-
to be printed
13 (Mac spool file format option)0=PDF mode, 1= PostScript-
mode
14 (Hide printing progress option)0=Display (default),-
1=Hide

Paper option (1): the list of all the names of available paper can be obtained using the PRINT OPTION VALUES command.

You can either pass the name of the paper in value1 (and, in this case, omit value2), or pass the paper width in value1 and its height in value2. The width and height must be expressed in screen pixels.

Orientation option (2): you can pass either 1 (Portrait), or 2 (Landscape) in value1.

Scale option (3): pass a percentage in value1. Be careful, some printers do not allow you to modify the scale. If you pass an invalid value, the property is reset to 100% at the time of printing.

Number of copies option (4): pass the number of copies to be printed in value1.

Paper source option (5): pass the number corresponding to the index, in the array of trays returned by the PRINT OPTION VALUES command, of the paper tray to be used.

Note: This option can only be used under Windows.

Color option (8): in value1, pass the code specifying the mode for handling color: 1=Black and white (monochrome), 2=Color.

Note: This option can only be used under Windows.

Destination option (9): in value1, pass the code specifying the type of print destination: 1=Printer, 2=File (PC)/PS (Mac), 3=PDF file (Mac OS only), 5=Screen (Mac OS X driver option).

If value1 is different from 1 or 5, pass the pathname for the resulting document in value2. This path will be used until another path is specified. If a file with the same name already exists at the destination location, it will be replaced. Under Windows only: if you pass an empty string in value2 or omit this parameter, a file saving dialog appears at the time of printing.

Double sided option (11): you can either pass 0 (Single-sided or standard), or 1 (Double-sided) in value1. If value1 equals 1, you can define the binding to be applied using value2: 0=Left binding (default value), 1=Top binding.

Note: This option can only be used under Windows.

Spooler document name option (12): in value1, pass the name of the print document that must appear in the list of spooler documents.

To use or restore standard operation (using the method name in the case of a method, the table name for a record, etc.), pass an empty string in value1.

Warning: The name defined by this statement will be used for all the print documents of the session for as long as a new name or an empty string is not passed.

Mac spool file format option (13): in value1, pass 0 to set the print job in PDF mode (default value) and 1 to "force" the print job in PostScript mode. This option has no effect under Windows.

Note: Under Mac OS X, printing is done as a PDF by default. However, the PDF print driver does not support PICT pictures with encapsulated PostScript information — these pictures are generated, more particularly, by vectorial drawing software.

To avoid this problem, this option lets you modify the print mode to use under Mac OS X for the current session. Keep in mind that printing in PostScript mode can lead to undesired side effects.

Hide printing progress option (14): pass 1 in value1 to hide the progress windows and 0 to display them again (default operation). This option is particularly useful in the case of PDF printing under Mac OS X.

Note: There is already a Printing progress option found in the Preferences dialog box (Application/Options page). However, it is applied globally to the application and does not hide all the windows under Mac OS X.

Once set using this command, a print option is kept throughout the duration of the session for the entire 4D application. It will be used by the PRINT SELECTION, PRINT LABEL, PRINT RECORD, Print form, and QR REPORT commands, as well as for all 4D printing, including that in Design mode.

Notes:

It is indispensable to use the optional > parameter with the PRINT SELECTION, PRINT LABEL, PRINT RECORD and PAGE BREAK commands in order to avoid resetting the print options that were set using the SET PRINT OPTION command.

The SET PRINT OPTION command only operates with PostScript printers.

See Also

GET PRINT OPTION, PRINT OPTION VALUES, SET CURRENT PRINTER.

System Variables or Sets

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

Error Handling

If the value passed for an option is invalid or if it is not available on the printer, the command returns an error (that you can intercept using an error-handling method installed by the ON ERR CALL command) and the current value of the option remains unchanged.

Constants

Print options theme.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next