On this Page

    DOM Properties Accessing the Document Structures

    In the Merge context one often wants to refer to properties of the objects in the various DOMs: _document, _page, _data. There is quite a large set of available properties to get, and often to update as well. The Script Editor dialog in DocOrigin Design provides you with ready access to these property names (and function names as well) by using a right-click context menu. You don't have to memorize every spelling, but do read through the upcoming lists and establish an understanding of all that is available. Not only do the DOMs themselves begin with "_" (underscore), but all properties do as well. This is to differentiate a DOM Object property such as _width from a potential DOM Tree element of, say, _document.Carton.width.

    Property

    Description

    ._absLeft
    ._absRight

    These are read-only convenience functions for getting the absolute positions, in microns, of the left and right of the object's virtual minimum enclosing rectangle. See also ._left and ._right.

    ._absTop
    ._absBottom

    These are convenience functions for getting and setting the absolute positions, in microns, of the top and bottom of the object's virtual minimum enclosing rectangle. (See also .top, .height). Note that these are computed properties not static ones. When one sets _absTop, one actually sets the _top of the object such that if _absTop were recomputed it would come out as desired. Similarly, setting _absBottom actually sets the _height of the object so that its _absBottom would evaluate to the desired value.

    ._adjustHeight

    (As of 3.1.002.06) Return or set the Adjust height flag for a Field, one of "true" or "false".

    ._adjustWidth

    (As of 3.1.002.06) Return or set the Adjust width flag for a Field, one of "true" or "false".

    ._allowBreakAfter

    (As of 3.1.002.06) Return or set the Allow Break After flag for a Pane, one of "true" or "false". Set before pagination.

    ._allowBreakBefore

    (As of 3.1.002.06) Return or set the Allow Break Before flag for a Pane, one of "true" or "false". Set before pagination.

    ._allowSplit

    (As of 3.1.001.10) Return or set the Allow split flag for a Pane, Group, Field or Label, one of "true" or "false".  

    ._allowMultiple

    (As of 3.1.001.10) Return or set the Allow multiple flag for a Pane or Row, one of "true" or "false". Set at the Start-of-Job or Start-of-Document event.

    ._autoFormat

    Set to "false" to turn off automatic formatting of Fields using Picture formatting. Note that setting to "true" does nothing. For example:

    this._value = Quantity._value * Price._value;
    if (this._value < 0) {
    this._value = "VOID";
    this._autoFormat = false;

    }

    This code would calculate an extended price and presumably format as currency. If the value was less than zero, the field would instead display VOID.

    ._background
    ._backgroundColor

    Return or set the background color. See Colors page for options.

    ._border

    Return or set the display of an object's border, one of "true" or "false".

    ._borderColor

    Return or set color of rectangle border. See Colors page for options.

    ._borderRadius

    Return or set the radius for rounded corners. Returned values are in microns. See the Script Units description for setting values.

    ._bottomInset

    Return or set the bottom inset for the object's border. Returned values are in microns. See the Script Units description for setting values.

    ._bottomMargin

    Return or set the bottom margin. Returned values are in microns. See the Script Units description for setting values.

    ._caption

    (As of 3.1.002.06) Return or set the caption field property. 

    ._collate

    Return or set the collate paper property. Best used on the Form object.

    ._color

    Return or set the text color. See Colors page for options.

    ._count

    Counts the number of sibling occurrences of a Pane or Row. Includes itself in the count. Caution required, see domObj.childNamed.

    ._currentContainer

    Returns a pointer to this object's Container object.

    ._currentPage

    Returns a pointer to this object's Page object.

    ._dataSource

    Return the Data DOM object whose value was used to populate this Field. This makes sense only on Document Field objects. In other cases, it will return NULL. See the _data section for details on what attributes can be used with a Data DOM object.

    ._date

    (As of 3.2.001.03) Returns the string value of a Field interpreted as a date and formatted as "yyyyMMdd" a string, empty string on failure.

    ._dateObj

    (As of 3.2.001.03) Returns the JavaScript date object initialized by the value of a Field interpreted as a date, null on fail.

    ._duplex

    (As of 3.1.001.10) Return or set a Form or Page's duplex property. Values are "dontChange", "simplex", "top", or "left".

    ._edge

    Return or set the drawing of the object's borders. Values are "all", "none" or any combination of: "top", "bottom", "left", and "right", separated by a space.

    ._firstChild

    Return the first (or only) child object of the current object. For example, if the current object is a Pane, then one could get the first object in that Pane. See also ._nextSibling.

    ._fontBold

    Return or set a Field's font bolding status, one of "true" or "false".

    ._fontItalic

    Return or set a Field's font italic status, one of "true" or "false".

    ._fontSize

    Return or set a Field's font point size.

    ._fontStrikeThrough

    (As of 3.1.001.15) Return or set a Field's font strike through status, one of "true" or "false".  

    ._fontTypeface

    Return or set a Field's font typeface name.

    ._fontUnderline

    Return or set a Field's underline option, one of "none", "single", "word", or "double".

    ._fullName

    Return the fully qualified name of the object in dotted notation, e.g. _document.SampleInvoice.Page1.CONTAINER1.InvoiceTable. This is most applicable when "walking the DOM" via ._nextNode.

    ._global

    (As of 3.0.003.11) Return whether a Field is marked as Global or not. Essentially read-only, since by Data Merged, setting it would have no effect whatsoever.

    ._height

    Return or set the height of an object. Returned values are in microns. See the Script Units description for setting values.

    ._hjustify
    ._horzJustify

    Return or set the horizontal justification "left", "right", "center", "spread", or "spreadAll".

    ._hyperlink

    Return or set a Field's hyperlink URL. See Hyperlinks for further information on hyperlinks.

    ._imageMode

    Return or set the Image Size/Crop to "Scale", "Clip", "Resize", "Stretch" or "FitWidth".

    ._imageName

    Return or set the Image file name of a Label object.

    ._initialValue

    (As of 3.2.001.01) Return or set a Field's Initial Value. This makes sense only before the End of Merge event.  

    ._input

    Return or set a Field's input status, one of "true" or "false". See Fillable Forms for further information and examples.

    ._inputAmPm

    Return or set Input Field AM/PM setting. If "true", use 12hr clock and AM/PM option, otherwise use 24hr clock.

    ._inputChoice

    Return or set Input Field choice list. See Fillable Forms for more information.

    ._inputClearButton

    Return or set Input Field Signature Clear button text. See Fillable Forms for more information.

    ._inputImage

    Return or set Input Field Image. See Fillable Forms for more information.

    ._inputLabel

    Return or set Input Field Label for choice lists, radio buttons etc. See Fillable Forms for more information.

    ._inputOrder

    Return or set Input Field AM/PM setting. If "true", use 12hr clock and AM/PM option, otherwise use 24hr clock.

    ._inputReadonly

    Return or set Input Field Readonly status, one of "true" or "false". See Fillable Forms for more information.

    ._inputRequired

    Return or set Input Field Required status, one of "true" or "false". See Fillable Forms for more information.

    ._inputRequiredMessage

    Return or set Input Field Required message text. See Fillable Forms for more information.

    ._inputShortMonth

    Return or set Input Field Date month style. Use "true" to display 'Jan' or "false" to display 'January'. See Fillable Forms for more information.

    ._inputShortYear

    Return or set Input Field Date year style. Use "true" to display '09' or "false" to display '2009'. See Fillable Forms for more information.

    ._inputTray

    Return or set the printer Input Tray for the current page.

    ._inputURL

    Return or set Input Field Post destination URL. See Fillable Forms for more information.

    ._inputYear

    Return or set Input Field date year range. See Fillable Forms for more information.

    ._lastChild

    Return the last (or only) child object of the current object. For example, if the current object is a Pane, then one could get the last object in that Pane. See also ._prevSibling.

    ._left
    ._top

    Return or set left or top position. Returned values are always in microns. See the Script Units description for setting values. The position is relative to top-left of the containing Pane, Cell, or Group. See also ._absLeft and ._absTop.

    ._leftInset

    Return or set the left inset for the object's border. Returned values in microns. See the Script Units description for setting values.

    ._leftMargin

    Return or set the left margin. Returned values in microns. See the Script Units description for setting values.

    ._lineSpacing

    Return or set line spacing for text. Returned values are always in microns. See the Script Units description for setting values.

    ._lineStyle

    Return or set the line style, one of "solid", "dash", "dot", or "dashDot".

    ._locale

    (As of 3.2.001.09) Return the _locale (Format Currency, Number, Date/Time) JavaScript object which is in effect for the current object. If the object's locale is not set then the ancestor objects are traversed to find the inherited locale.  

    ._localeName

    (As of 3.1.00.10) Return or set the Locale (e.g. en_US) for the current object. Often this will be null and the ancestor tree will have to be followed to find the inherited locale in effect.  

    ._mandatory

    (As of 3.1.002.04) Return or set the Mandatory flag for a Pane, Row or Page, one of "true" or "false". Set at Start-of-Job or Start-of-Document

    ._minHeight

    Return or set minimum height allowed for this pane. Returned values in microns. See the Script Units description for setting values.

    ._name

    Return or set an object's Name.

    ._nextNode

    Return the next object in the DOM from top to bottom. This is an easy way to "walk the entire DOM". NULL is returned at the end of the DOM.

    ._nextSibling

    Return the next child of a parent. Follows usage of ._firstChild or ._lastChild. NULL is returned if no more children exist in the desired next/previous direction.

    ._num

    Returns the value of a Field as a raw number. This will remove any existing number formatting from a field value such as $1,234.56 and return the number 1234.56.

    ._numberOfChildren

    Return the number of children that the given object has.

    ._numberOfPages

    Return the total number of pages in the document. This applies only on or after the Pagination Completed event.

    ._numCopies

    Return or set the number of copies to be produced. Best used on the Form object.

    ._occurrence

    Return an object's occurrence number within its enclosing parent pane. The numbers start at 0 the third occurrence of an object would return a value of 2. Typically used with repeating Panes.

    ._onSplitHeader

    (As of 3.1.002.06) Return or set the OnSplit Headers... property for a Pane or Overflow Headers... for a Container. It's a space-separated list of header panes.  

    ._onSplitFooter

    (As of 3.1.002.06) Return or set the OnSplit Footers... property for a Pane or Overflow Footers... for a Container. It's a space-separated list of footers panes.  

    ._originalForm

    Return a Page's "original form name" for a composite Form created using DocOriginCombineForms.

    ._outputBin

    Return or set the printer Output bin for the current page.

    ._overflowText

    Return any text that overflows from a fixed-size text Field. Not applicable to Single line Fields, or Fields set to Adjust height.

    ._pageBreak

    Return or set page break flag for a Pane.

    ._pageCount

    Return the number of pages in the document. This makes sense only after the Pagination Completed event.

    ._pageCountForm

    (As of 3.1.002.02) Return the number of pages in the form.   

    ._pageNumber

    Return the page# of the object document based. Since repeating line items (Panes) typically cause multiple pages to print, the final page number is not set until the OnEndPaginate() event. Prior to this event, all Fields will have the same page number.

    ._pageNumberForm

    (As of 3.1.002.02) Return the page# of the object form based.   

    ._pageOrientation

    (As of 3.2.001.01) Return or set a Page's Orientation, one of "Portrait" or "Landscape".   

    ._pagePlacement

    (As of 3.1.001.10) Return or set a Page's placement property, one of "any", "anyFromFront" and as of 3.2.001.11, "front", or "back".  

    ._paperSize

    (As of 3.2.001.01) Return or set the Paper size, one of "A4", "Letter", etc.  

    ._paperType

    Return or set the Paper type for the current page.

    ._parent

    Return the parent object of the current object. This returns NULL when at the top of the DOM's ancestor stack.

    ._picture

    Return or set a Field's picture clause. DocOrigin uses the ICU package for picture formatting. See setting-time-zones.

    ._presence

    Return or set the presence of an object, one of "yes", "no", or "none". "none" indicates that the object takes up no space at design or print time.

    ._prevSibling

    Return the previous child of a parent. Follows usage of ._firstChild, or ._lastChild. NULL is returned if no more children exist in the desired next/previous direction.

    ._raw

    Return the current Field/Label value. For Fields, this is the value before Field formatting has been applied (number, currency, date, and so on). See ._value.

    ._rightInset

    Return or set the right inset for the object's border. Returned values are in microns. See the Script Units description for setting values.

    ._rightMargin

    Return or set the right margin. Returned values are in microns. See the Script Units description for setting values.

    ._rowCount

    Counts the number of child Rows or Panes of a Table or Pane. Table Rows marked as headers or footers are ignored in this count.

    ._sheetCount

    Return the number of sheets of paper required to print the document. This makes sense only after the Pagination Completed event.

    ._singleLine

    (As of 3.1.002.06) Return or set the Single line flag for a field, one of "true" or "false".

    ._templateObject

    Return the Template (Form) DOM object from which the given Document DOM object was created. This makes sense on only Document DOM objects. In other cases, it will return NULL. This is useful for retrieving the value that an attribute was set to at design time. Often _height has a different value in the Document DOM than it has in the Template DOM. For example: var designHeight = this._templateObject._height;

    ._textWidth

    Returns the width of the longest (widest) line in a text block, in microns. See also _overflowText.

    ._thickness

    Return or set the border thickness in microns.

    ._topInset

    Return or set the top inset for the object's border. Returned values are in microns. See the Script Units description for setting values.

    ._topMargin

    Return or set the top margin. Returned values are in microns. See the Script Units description for setting values.

    ._transparent

    Return or set the object's transparency, one of "true" or "false". Set to "true" on an Image to allow what is under the Image to show through in the Image's lighter areas. See TransparencyMask in your configuration file.

    ._type

    Return the type of a document object. See the table of those type values below.

    ._value

    Return or set the current Field/Label value. The returned Field value has formatted text after applying the formatting (number, currency, date, and so on) to the original data. See ._raw.

    ._viewerAttributes

    Return or set a Field's viewer attributes. See Fillable Forms for further information and examples.

    ._visible

    Return or set the visibility of the Field or Label, one of "true" or "false".

    ._vjustify
    ._vertJustify

    Return or set the vertical justification, one of "top", "bottom", or "middle".

    ._width

    Return or set the width of an object. Returned values are in microns. See the Script Units description for setting values.


    Object type values returned from object._type

    "Form", "Page", "Container", "Pane", "Group", "Line", "Rectangle", "Table", "Row", "Cell"

    "Field-Text-String", "Field-Text-Number", "Field-Text-Currency",
    "Field-Text-DateTime", "Field-Text-Date", "Field-Text-Time"

    "Field-Checkbox", "Field-Radiobutton", "Field-Image", "Field-Barcode", "Field-Comb"

    "Label-Text", "Label-Image", "Label-Barcode"

    "Arc", "PolyLine" dynamically generated by _chart

    Examples

    1. The following example determines the sum of an amount_total field by page:

    // abbreviation for repeating panes
    var r = _document.main_pane.detail_table.detail_line;
    var sum=0.0; var page=1;
    
    for (var i=0; i < r[0]._count; i++) {
    	if (r[i]._pagenumber != page) { // when the page# changes, print info
    		_printf("Sum for page %d is %10.2f\n", page, sum);
    		sum = 0.0; page++;
    	}
    	sum = sum + r[i].extended_amount._num;
    }
    _printf("Sum for page %d is %10.2f\n", page, sum);

    2. While it is not often that scripting adjusts object locations, here is an example that makes a "trailer" pane into a page"footer". Used in the Pagination Completed event. Imagine that this is on a "totals" pane or something of that nature.

    // Place this pane at the very bottom of the container
    this._absTop = this._currentContainer._absBottom - this._height;