Implements

Constructors

  • Create a TextObjectUtils instance. Instead of creating an instance in new mode, use create to create an instance.

    Parameters

    • Optionaloptions: Options

      Create a TextObjectUtils instance with the specified options.

    Returns TextObjectUtils

    const pdfArr = await TextObjectUtils.create();
    

Properties

options: Options

Methods

  • get font

    Parameters

    • graphicObjectUtils: GraphicObjectUtilsType

      The graphic object utilities to use.

    • isFullName: boolean

      Whether to get the full name of the font.

    Returns Promise<string>

    A promise that resolves to the name of the font.

  • set char space

    Parameters

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the char space was successfully set.

  • set fill info

    Parameters

    • graphicObjectUtils: GraphicObjectUtilsType

      The graphic object utilities to use.

    • isFill: boolean

      Whether to enable fill.

    • color: RGBColor

      The fill color.

    • addUndo: boolean

      Whether to add an undo step.

    Returns Promise<void>

    A promise that resolves when the fill info is set.

  • set font

    Parameters

    • __namedParameters: {
          bold?: boolean;
          fontName: string;
          graphicObjectUtils: GraphicObjectUtilsType;
          italic?: boolean;
          opType: FPD_FONTOPERATION;
      }

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the font was successfully set.

  • set font size

    Parameters

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the font size was successfully set.

  • set horizontal scale

    Parameters

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the horizontal scale was successfully set.

  • set line width

    Parameters

    • graphicObjectUtils: GraphicObjectUtilsType

      The graphic object utilities to use.

    • lineWidth: number

      The line width to set.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the line width was successfully set.

  • set stroke info

    Parameters

    • graphicObjectUtils: GraphicObjectUtilsType

      The graphic object utilities to use.

    • isStroke: boolean

      Whether to enable stroke.

    • color: RGBColor

      The stroke color.

    • addUndo: boolean

      Whether to add an undo step.

    Returns Promise<void>

    A promise that resolves when the stroke info is set.

  • set word space

    Parameters

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the word space was successfully set.

  • Creates a TextObjectUtils instance.

    Parameters

    • Optionaloptions: Options

      The configuration options required for creation, containing necessary initialization information.

    Returns Promise<TextObjectUtils>

    A promise that resolves to a TextObjectUtils instance.