DS Server

InputFormat Object

Object|Introduced in 28.0

Description

The InputFormat object represents all formatting attributes at the current text input position. If text is selected and the selection has no common value for a certain attribute, the corresponding property is null.

Syntax

InputFormat

Examples

The following example demonstrates InputFormat in a practical document-editing workflow. The InputFormat object represents all formatting attributes at the current text input position. If text is selected and the selection has no common value for a certain attribute, the corresponding property is null.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.inputFormat.getAllFrameLines(
    function(result) {
        if (result) {
            console.log("get all frame lines is available.");
        } else {
            console.warn("get all frame lines is not available in the current document state.");
        }
    },
    onTxError
);

Members

Methods

MethodDescription
addEventListenerThe addEventListener function registers event listener functions on the InputFormat object.
getAllFrameLinesGets a value specifying whether all frame lines, including all inner frame lines, are set for the selected text.
getBoldGets a value specifying whether text is bold at the current input position.
getBottomAlignedGets a value specifying whether text is bottom aligned at the current input position.
getBottomDistanceGets bottom's paragraph distance, in twips, at the current input position.
getBoxFrameGets a value specifying whether there is a complete frame around the text.
getBulletCharacterGets the bullet character at the current input position.
getBulletedListGets a value specifying whether there is a bulleted list at the current input position.
getCenteredGets a value specifying whether text is centered at the current input position.
getFontFamilyGets the font family at the current input position.
getFontSizeGets the font's size, in points, at the current input position.
getFrameFillColorGets the color used to display the frame fill color at the current input position.
getFrameLineColorGets the color used to display the color of frame lines at the current text input position.
getFrameLineWidthGets the line width, in twips, of the paragraph's or table's frame at the current input position.
getHangingIndentGets the hanging indent, in twips, at the current input position.
getInnerHorizontalFrameLinesGets a value specifying whether all inner horizontal frame lines are set for the selected text.
getInnerVerticalFrameLinesGets a value specifying whether all inner vertical frame lines are set for the selected text.
getItalicGets a value specifying whether the text is italic at the current input position.
getJustifiedGets a value specifying whether text is justified at the current input position.
getLeftAlignedGets a value specifying whether text is left aligned at the current input position.
getLeftFrameLineGets a value specifying whether there is a frame line at the left side of the text.
getLeftIndentGets the left indent, in twips, at the current input position.
getLeftToRightGets a value specifying whether the writung direction is left-to-right at the current input position.
getLinespacingGets the line spacing, in percent, at the current input position.
getNumberedListGets a value specifying whether there is a numbered list at the current input position.
getNumberedListFormatGets the number format for a numbered list at the current input position.
getNumberFormatsGets an array of all supported number formats for numbered and structured lists.
getRightAlignedGets a value specifying whether text is right aligned at the current input position.
getRightFrameLineGets a value specifying whether there is a frame line at the right side of the text.
getRightIndentGets the right indent, in twips, at the current input position.
getRightToLeftGets a value specifying whether the writing direction is right-to-left at the current input position.
getStrikeoutGets a value specifying whether the text is strikeout at the current input position.
getStructuredListGets a value specifying whether there is a structured list at the current input position.
getStructuredListFormatGets the number format for a structured list at the current input position.
getStructureLevelGets the structure level of all selected paragraphs. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document.
getStyleNameGets the formatting style name at the current input position.
getStyleNamesReturns an array of the names of all formatting styles, the document contains.
getSubscriptGets a value specifying whether text is subscript at the current input position.
getSuperscriptGets a value specifying whether text is superscript at the current input position.
getSupportedFontFamiliesReturns an array of strings specifying all supported fonts.
getSupportedFontSizesGets an array of strings specifying all possible font sizes for the font at the text input position. If the font is free scalable, standard sizes are returned. The return value is the list of possible font sizes. Null is returned, if the specified font is not supported or if text is selected and the selection contains several different fonts.
getSupportedUnderlineStylesGets an array of all supported underline styles.
getTextBackColorGets the color used to display the text's background color at the current input position.
getTextColorGets the color used to display the text at the current input position.
getTopAlignedGets a value specifying whether text is top aligned at the current input position.
getTopDistanceGets a top paragraph distance, in twips, at the current input position.
getTopFrameLineGets a value specifying whether there is a frame line at the top of the text.
getUnderlineGets a value specifying whether text is underlined at the current input position.
getUnderlineStyleGets a value specifying the style at the current input position.
getVerticallyCenteredGets a value specifying whether text is vertically centered at the current text input position.
removeEventListenerThe removeListener function removes the specified event listener from the InputFormat object.
setAllFrameLinesSets a value specifying whether all frame lines, including all inner frame lines, are set for the selected text.
setBoldSets a value specifying whether text is bold at the current input position.
setBottomAlignedSets a value specifying whether text is bottom aligned at the current input position.
setBottomDistanceSets a bottom paragraph distance, in twips, at the current input position.
setBoxFrameSets a value specifying whether there is a complete frame around the text.
setBulletCharacterSets the bullet character at the current input position.
setBulletedListSets a value specifying whether there is a bulleted list at the current input position.
setCenteredSets a value specifying whether text is centered at the current input position.
setFontFamilySets the font family at the current input position.
setFontSizeSets the font's size, in points, at the current input position.
setFrameFillColorSets the color used to display the frame fill color at the current input position.
setFrameLineColorSets the color used to display the color of frame lines at the current text input position.
setFrameLineWidthSets the line width, in twips, of the paragraph's or table's frame at the current input position.
setHangingIndentSets the hanging indent, in twips, at the current input position.
setInnerHorizontalFrameLinesSets a value specifying whether all inner horizontal frame lines are set for the selected text.
setInnerVerticalFrameLinesSets a value specifying whether all inner vertical frame lines are set for the selected text.
setItalicSets a value specifying whether the text is italic at the current input position.
setJustifiedSets a value specifying whether text is justified at the current input position.
setLeftAlignedSets a value specifying whether text is left aligned at the current input position.
setLeftFrameLineSets a value specifying whether there is a frame line at the left side of the text.
setLeftIndentSets the left indent, in twips, at the current input position.
setLeftToRightSets a value specifying whether the writung direction is left-to-right at the current input position.
setLinespacingSets the line spacing, in percent, at the current input position.
setNumberedListSets a value specifying whether there is a numbered list at the current input position.
setNumberedListFormatSets the number format for a numbered list at the current input position.
setRightAlignedSets a value specifying whether text is right aligned at the current input position.
setRightFrameLineSets a value specifying whether there is a frame line at the right side of the text.
setRightIndentSets the right indent, in twips, at the current input position.
setRightToLeftSets a value specifying whether the writing direction is right-to-left at the current input position.
setStrikeoutSets a value specifying whether the text is strikeout at the current input position.
setStructuredListSets a value specifying whether there is a structured list at the current input position.
setStructuredListFormatSets the number format for a structured list at the current input position.
setStructureLevelSets the structure level of all selected paragraphs. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document.
setStyleNameSets the formatting style name at the current input position.
setSubscriptSets a value specifying whether text is subscript at the current input position.
setSuperscriptSets a value specifying whether text is superscript at the current input position.
setTextBackColorSets the color used to display the text background color at the current input position.
setTextColorSets the color used to display the text at the current input position as a CSS color string.
setTopAlignedSets a value specifying whether text is top aligned at the current input position.
setTopDistanceSets a top paragraph distance, in twips, at the current input position.
setTopFrameLineSets a value specifying whether there is a frame line at the top of the text.
setUnderlineSets a value specifying whether text is underlined at the current input position.
setUnderlineStyleSets a value specifying the style at the current input position.
setVerticallyCenteredSets a value specifying whether text is vertically centered at the current text input position.