ComPDFKit Web SDK
    Preparing search index...

    Interface TextAttributes

    Text style of a range in a text content box. Read values describe the first character of the range unless noted; set values apply to the whole range.

    interface TextAttributes {
        bold?: boolean;
        characterSpacing?: number | null;
        color?: string;
        fontName?: string;
        fontSize?: number;
        fontStyle?: FontStyle;
        italic?: boolean;
        lineSpacing?: number;
        opacity?: number;
        paragraphSpacing?: number;
        strikeout?: boolean;
        textAlign?: "left" | "right" | "center" | "justify";
        underline?: boolean;
    }
    Index
    bold?: boolean

    Whether the text is bold.

    characterSpacing?: number | null

    Character spacing (pt); null when it differs within the range.

    color?: string

    Text color. Read as '#rrggbb'; set as '#rrggbb' or 'rgb(r, g, b)' with channels 0-255.

    fontName?: string

    Font name, such as 'Helvetica'. See getContentEditingFonts for settable names.

    fontSize?: number

    Font size in points.

    fontStyle?: FontStyle

    Sets bold and italic together (ComPDFKit extension): 0 / 'regular', 1 / 'bold', 2 / 'italic' / 'oblique', 3 / 'boldItalic' / 'boldOblique'. An explicit bold or italic in the same call overrides its half. Write-only.

    italic?: boolean

    Whether the text is italic.

    lineSpacing?: number

    Line spacing as a multiple (1 is single); reads the line of the first character in the range, sets every line in the range.

    opacity?: number

    Text opacity 0–1.

    paragraphSpacing?: number

    Space after paragraph (pt); reads the paragraph of the first character, sets every paragraph in the range.

    strikeout?: boolean

    Whether the text is struck out.

    textAlign?: "left" | "right" | "center" | "justify"

    Paragraph alignment.

    underline?: boolean

    Whether the text is underlined.