4D v16

WP PRINT

Home

 
4D v16
WP PRINT

WP PRINT 


 

WP PRINT ( wpDoc {; printLayout} ) 
Parameter Type   Description
wpDoc  Object in Name of 4D Write Pro document
printLayout  Longint in 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 (only on 64-bit versions of 4D, see below). 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

 

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).

The WP PRINT command is supported in 4D 32-bit versions but with the following limitation: it cannot be called within a 4D print job started with OPEN PRINTING JOB. If the command is called in a print job on a 32-bit version of 4D, an error is returned.

Example  

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



See also 

WP USE PAGE SETUP

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language

 
HISTORY 

New
Created: 4D v15 R5
Modified: 4D v16

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v16)