4D v15WP EXPORT DOCUMENT |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v15
WP EXPORT DOCUMENT
|
WP EXPORT DOCUMENT ( wpDoc ; filePath {; format {; option}} ) | ||||||||
Parameter | Type | Description | ||||||
wpDoc | Object |
![]() |
4D Write Pro variable | |||||
filePath | String |
![]() |
Path of exported file | |||||
format | Longint |
![]() |
Document output format | |||||
option | Longint |
![]() |
Export options | |||||
The WP EXPORT DOCUMENT command exports the wpDoc 4D Write Pro object to a document on disk according to the filePath parameter as well as any optional parameters.
In wpDoc, pass the 4D Write Pro object that you want to export.
In filePath, pass the destination path and the name of the document to be exported. If you pass only the document name, it will be saved at the same level as the 4D structure file. By default, if you omit the format parameter, the command uses the document extension to select the file format.
You can also pass a constant from the 4D Write Pro Constants theme in the format parameter. In this case, 4D adds the appropriate extension to the file name if needed. The following format is supported:
Constant | Type | Value | Comment |
wk web page complete | Longint | 2 | .htm or .html extension. The document is saved as standard HTML and its resources are saved separately. 4D tags are removed and expressions are computed. This format is particularly suitable when you want to display a 4D Write Pro document in a web browser. |
Notes:
In the options parameter, you pass options that will configure the export. You can pass a longint value to define the style of the HTML code. The following constants are available:
Constant | Type | Value | Comment |
wk html debug | Longint | 1 | Formatted HTML code ("pretty print"), easier to debug |
wk normal | Longint | 0 | Standard HTML code |
You want to export the contents of the myArea 4D Write Pro object to a document in your database folder. You can set the debug option using a 'pprint' button:
C_TEXT($filePath)
$filePath:=Get 4D folder(Database folder)+"Exported files"+Folder separator+"WriteProExport.html"
If(pprint=0) //if the debug option is off
WP EXPORT DOCUMENT(myArea;$filePath;wk web page complete;wk normal)
Else
WP EXPORT DOCUMENT(myArea;$filePath;wk web page complete;wk html debug)
End if
Product: 4D
Theme: 4D Write Pro Language
Created: 4D v14 R5
4D Write Pro Reference ( 4D v15)