This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
BLOB to print settings
|
BLOB to print settings ( printSettings {; params} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
printSettings | BLOB |
![]() |
BLOB containing print settings | |||||
params | Longint |
![]() |
0=Restore saved values for number of copies and page range, 1=Reset to default values | |||||
Function result | Longint |
![]() |
Status code: 1=Operation successful, 0=No current printer, -1=Incorrect parameters, 2=Printer changed | |||||
The BLOB to print settings command replaces the current 4D print settings with the parameters stored in the printSettings BLOB. This BLOB must have been generated by the Print settings to BLOB command or the 4D Pack command (see below).
The params parameter allows you to define how to handle the basic "number of copies" and "page range" settings:
The parameters are applied to the current 4D printing settings as long as no command such as _o_PAGE SETUP, SET PRINT OPTION or PRINT SELECTION without the > parameter modifies them. The parameters set are used more particularly by the PRINT SELECTION, PRINT LABEL, PRINT RECORD, Print form and QR REPORT commands, as well as by the menu commands of 4D, including those of the Design environment.
The PRINT SELECTION, PRINT LABEL, and PRINT RECORD commands must be called with the > parameter (if applicable) in order for the settings defined by BLOB to print settings to be kept.
The command returns one of the following status codes:
(*) Settings depend on the currently selected printer at the moment the BLOB was saved. Applying these settings to a another printer is supported if both printers are of the same model. If the printers are different, only common parameters will be restored.
The printSettings BLOB can be saved and read on both platforms. However, even if some print settings are common, some others are platform-specific and depend on the drivers and system versions. If the same printSettings BLOB is shared between both platforms, you may lose parts of the information.
When used in a heterogeneous environment, in order to restore the maximum settings available for each platform (and not only the common part), it is recommended that you work with two printSettings BLOBs, one for each platform.
The print settings BLOBs generated by the legacy command from 4D Pack can be loaded and used by the BLOB to print settings command. Note however that if they are saved using Print settings to BLOB, they are converted and can no longer be opened using . The BLOB to print settings command stores much more printing information than .
You want to apply print settings previously saved to disk to the current 4D printing context:
C_BLOB(curSettings)
DOCUMENT TO BLOB(Get 4D folder(Active 4D Folder)+"current4Dsettings.blob";curSettings)
//current4Dsettings has been created by Print settings to BLOB
$err:=BLOB to print settings(curSettings;0)
Case of
:($err=1)
//everything is OK
:($err=2)
CONFIRM("Printer has changed!\n\nCheck the print settings?")
If(OK=1)
PRINT SETTINGS
End if
:($err=0)
ALERT("There is no current printer.")
:($err=-1)
ALERT("Invalid settings file.")
End case
Product: 4D
Theme: Printing
Number:
1434
Created: 4D v16
4D Language Reference ( 4D v20 R7)