This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Importing and Exporting in .docx format
|
Setting | Description |
Anchored text areas | Anchored text areas are imported as text boxes by default (they can also be ignored or imported as inline text, see WP Import document command option). Only simple text areas can be imported. Inline text areas are imported as anchored in the front layer. Text areas anchored with text around are imported with their text wrapping properties (exception: the .docx wrapping option "tight" is imported as wrap square). |
Paragraph layout | Only Western text layouts are supported. Distributed, Thai and Asian paragraph styles are not supported. |
Page Size | Different page sizes per section are not supported. Only the page size from the first section is imported. |
Setting | Description |
Watermark | Not supported |
Setting | Description |
MS Word equations | Not supported. Data is not imported. |
MS Word charts | Not supported. Data is not imported. |
Setting | Description | |
Hierarchical lists | Multi-level lists are not supported. Multi-level lists are converted to a single level lists so list appearance and/or numbering may be different |
Setting | Description |
DrawingML shapes | Only simple DrawingML images (inline or anchored) are imported. Complex DrawingML shapes are not supported. |
VML shapes or images | Not supported. VML is obsolete in MS Word and should not be used in documents created with MS Word 2010 or older. |
3D models | Not supported, however the last rendered 2D image of the 3D model may be imported if present in the .docx. |
SmartArt | Not supported. |
Setting | Description |
Comments | Not supported. Content is not imported. |
Footnotes | Not supported. Content is not imported. |
Setting | Description |
"At least" line spacing | Not supported. "At least" line spacing is converted to fixed (single) line spacing. |
Fit text | Not supported. The normal 4D Write Pro style is used. |
Setting | Description |
Tables | Contiguous tables do not merge automatically. |
Setting | Description |
Themes | Text themes are not imported. If a color or font definition references a color or font in a theme, the last computed color or font will be used. Otherwise, the |
color or font defined in the theme is used. |
When importing .docx format into 4D Write Pro, a log object is created and included within the imported document object. This object can be retrieved through the "importLog" custom attribute (or wk import log constant):
$myDoc:=WP Import document("test.docx")
if($myDoc#Null)
var $log : Object
$log:=$myDoc[wk import log]
End if
The import log object contains the following properties:
Constant | Comment | ||||||||||||||||||||||||||||||||||||
wk import log | Log object containing information about the .docx import operation. Properties are read-only and cannot be set:
Warning: importLog is a custom attribute, thus the wk import log constant cannot be used by WP SET ATTRIBUTES, WP GET ATTRIBUTES or WP RESET ATTRIBUTES command (for more information, see Using custom attributes). |
4D Write Pro objects offer two ways to export 4D Write Pro documents in .docx format:
For more information, please refer to the description of these commands.
While the majority of 4D Write Pro settings are preserved, some settings are known to be either unsupported or behave differently in Microsoft Word. These are:
Setting | Paragraphs | Sections | Images |
Anchoring | In Microsoft Word, anchored images are positioned relatively to the top left origin of the page and first paragraph. This could result in images being displayed in different locations than desired due to text layout differences between 4D Write Pro and Microsoft Word. | ||
Text boxes anchored to embedded area are not exported. Rendering can be different in Microsoft Word. | |||
Vertical align | Not supported by Microsoft Word (all items will be top-aligned) | Not supported for inline images (all items will be baseline) |
Setting Paragraphs Sections Images Background clipping Not supported by Microsoft Word (background color fills entire paragraph, not including borders and margins) Not supported by Microsoft Word (background clipping will be equal to the padding box) Background image Not supported by Microsoft Word Different background pictures/colors not supported by Microsoft Word (converted to anchored images or shapes) Microsoft Word allows either a background color or a background image. If a background image is defined, the background color will be "transparent". Background image repeat Horizontal or vertical tiles are converted to full tiles in Microsoft Word Horizontal or vertical tiles are converted to full tiles in Microsoft Background origin Origin box is converted to the same value as background clipping box. Not supported by Microsoft.
Setting Paragraphs Sections Images Border color Different border colors for each border line is not supported by Microsoft Word. The first defined 4D Write Pro image border line (in this order: top, right, bottom, left) will be used for all of an image's borders. Border radius (rounded borders) Not supported by Microsoft Word Border width Microsoft Word maximum is 12pt, borders exceeding this size will be reduced. Microsoft Word maximum is 12pt, borders exceeding this size will be reduced.
Setting | Paragraphs | Sections | Images |
Expressions | Only simple 4D expressions such as "Current date" or "Current time", or 4D Write Pro reserved local variables ($wp_title, $wp_pageNumber, etc.) are converted to Microsoft Word fields. Other 4D expressions are computed and converted to text or images during the export process. |
Setting | Paragraphs | Sections | Images |
Indent | Converted to 0 for list items (list item indent is converted to hanging indent in Microsoft Word) | ||
Ordered list type | Greek, Armenian, and Georgian are converted to decimal and Hiragana is converted to Katakana in Microsoft Word. |
Setting | Paragraphs | Sections | Images |
SVG | Not supported by Microsoft Word (images in SVG format will be converted to PNG format) |
Setting | Paragraphs | Sections | Images |
Minimum height | Not supported by Microsoft Word (height is handled automatically) | ||
Width / Minimum width | Not supported by Microsoft Word (paragraph width is handled automatically) |
Setting Paragraphs Sections Images Padding Microsoft Word maximum is 31pt, padding exceeding this size will be reduced. Microsoft Word maximum is 31pt, padding exceeding this size will be reduced.
Feature | Description |
Bottom carry-over row | Not exported. |
Setting | Paragraphs | Sections | Images |
Default tab stop | Not supported by Microsoft Word (will be converted to absolute tab stops) | ||
Tab leading characters | Microsoft Word supports "dot" (....), "dash" (----), and "underscore" (____) leading characters, all others will be converted to "none". |
Setting | Paragraphs | Sections | Images |
Linethrough | Line color different from text color is not supported by Microsoft Word; only solid and double styles are supported | ||
Style Sheets | Paragraph style sheets are converted to paragraph styles. | ||
Text align | Microsoft Word compresses spaces, so justified text layout may be reconfigured. | Microsoft Word compresses spaces, so justified text layout may be reconfigured. | |
Text shadow | 4D Write Pro shadow will be converted to blur and offset, using the default color in Microsoft Word. | ||
Underline | Semi-transparent underlines will be converted to solid. |
Product: 4D
Theme: Importing and Exporting in .docx format
Created: 4D v17 R4
Modified: 4D v18 R6
Modified: 4D v19
4D Write Pro Reference ( 4D v20 R7)