This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v18
WP PRINT
|
WP PRINT ( wpDoc {; printLayout} ) | ||||||||
Parameter | Type | Description | ||||||
wpDoc | Object |
![]() |
4D Write Pro document | |||||
printLayout | Longint |
![]() |
Print layout for 4D Write Pro document: 0 (default)=4D Write Pro layout, 1=HTML WYSIWYG | |||||
The WP PRINT command launches a print job for the 4D Write Pro document specified in wpDoc, or adds the document to the current print job if it is called between OPEN PRINTING JOB and CLOSE PRINTING JOB. WP PRINT uses print settings defined by the 4D PRINT SETTINGS or SET PRINT OPTION commands, except for page margins which are always based on the 4D Write Pro document page settings. WP PRINT uses current page setup options (such as page size and orientation), or those of the document if WP USE PAGE SETUP was called previously.
The optional printLayout parameter can be used to set the HTML WYSIWYG view for the print output. You can pass one of the following constants from the "4D Write Pro" theme:
Constant | Type | Value | Comment |
wk 4D Write Pro layout | Longint | 0 | Standard 4D Write Pro layout, which can include some specific style attributes |
wk html wysiwyg | Longint | 1 | In this layout, any 4D Write Pro advanced attributes which are not compliant with all browsers are removed (e.g. columns, double underlines...) |
If printLayout is omitted, 4D Write Pro layout (0) is used by default.
Note: When printed with WP PRINT, 4D Write Pro documents are always printed as in Page view mode, regardless of the View property setting for the area (see Configuring View properties).
You want to print a 4D Write Pro document in standard or HTML wysiwyg layout depending on the value of a variable:
// print using a specific layout HTML wysiwyg or 4D Write Pro Layout
If(rb_htmlwysiwyg=1)
WP PRINT(writeProDoc;wk html wysiwyg)
Else
WP PRINT(writeProDoc;wk 4D Write Pro layout)
End if
Product: 4D
Theme: 4D Write Pro Language
Number:
1343
Created: 4D v15 R5
Modified: 4D v16
4D Write Pro Reference ( 4D v18)