4D v16Accessing document contents by programming |
||
|
4D v16
Accessing document contents by programming
Accessing document contents by programming
4D Write Pro provides a full set of commands allowing you to modify text and image attributes in your documents. Thanks to these features, 4D developers can design their own user interfaces (using buttons, menus, check boxes, etc.) for 4D Write Pro documents. Commands can be applied to whole documents or to specific portions (ranges), either based on user selections or custom values. Available properties include document units, margins, padding, background, paragraph settings, colors, fonts, font styles, as well as image properties. For example, the 4D Write Pro area library object makes extensive use of these features to provide a sophisticated 4D Write Pro interface:
Several commands are dedicated to handling selections in the documents. Since selected text can contain (invisible) formatting tags, 4D Write Pro works with ranges. A range is an object that represents a portion of a 4D Write document.
4D Write Pro allows you to create and work with dynamic references to parts of your documents, called bookmarks. A bookmark is a named reference attached to a specific range in a 4D Write Pro document. Bookmarks are dynamic, which means that if the user moves, adds or removes text belonging to the bookmark, the associated range will be updated automatically and the bookmark will continue to reference the same content within the document. For example:
A document can contain an unlimited number of bookmarks. Several bookmarks can reference the same range, and bookmark ranges can be interleaved. However, each bookmark name must be unique in the document. Bookmarks are not imported when using the MissingRef or WP New command (bookmarks in the destination document cannot be overwritten). Once created, a bookmark is stored within the document. It is saved with the document, and can be handled by several different commands. It can also be used to reference parts of a template document. These parts can then be assembled automatically with data from the database to produce dynamic output documents such as invoices or catalogs. Several commands allow you to create, remove, and use bookmarks:
The following commands can get or set any attributes of the document:
Attributes are detailed in the 4D Write Pro Attributes section. This command allows you to get information about style support for a range:
See also
|
PROPERTIES
Product: 4D
HISTORY
ARTICLE USAGE
4D Write Pro Reference ( 4D v16) |