ComPDF React Native - v3.0.0
    Preparing search index...

    Class CPDFTextWidget

    Class representing a text field form widget, storing basic information about the text field form. It includes general form attributes as well as the text content of the text field.

    CPDFTextWidget

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Update text widget properties with type safety

      Parameters

      • updates: Partial<
            Pick<
                CPDFTextWidget,
                | "title"
                | "text"
                | "isMultiline"
                | "fontColor"
                | "fontSize"
                | "alignment"
                | "familyName"
                | "styleName"
                | "borderColor"
                | "fillColor"
                | "borderWidth",
            >,
        >

        Partial object containing properties to update

      Returns this

      this instance for chaining

      textWidget.update({
      title: 'Updated Title',
      text: 'New text',
      fontColor: '#FF0000',
      fontSize: 14,
      alignment: CPDFAlignment.CENTER
      });
      await document.updateWidget(textWidget);
    • Type Parameters

      Parameters

      • this: new (params: Partial<T>) => T
      • json: any

      Returns T

    • Type Parameters

      Parameters

      • this: new (params: Partial<T>) => T
      • jsonArray: any[]

      Returns T[]

    • Returns Omit<CPDFTextWidget, "createDate" | "update" | "toJSON"> & {
          createDate?: number;
          borderColor: string;
          fillColor: string;
          borderWidth: number;
      }

    Properties

    text: string

    The text content of the text field.

    isMultiline: boolean

    Indicates if the text field is multiline (default: false).

    fontColor: string

    The font color of the text field (default: '#000000').

    familyName: string

    The font family name of the text field.

    styleName: string

    The font style name of the text field.

    fontSize: number

    The font size of the text field (default: 0).

    alignment: CPDFAlignment

    The alignment of the text field (default: CPDFAlignment.LEFT).

    The type of the form widget.

    title: string

    The title of the form widget (default: empty string).

    page: number

    The page number where the form widget appears (default: 0).

    uuid: string

    The unique identifier for the form widget (default: empty string).

    createDate: Date | null = null

    The date when the form widget was created (default: null).

    rect: CPDFRectF | null = null

    The rectangular coordinates of the form widget (default: null).

    borderColor: string

    The border color of the form widget (default: '#000000').

    fillColor: string

    The fill color of the form widget (default: '#000000').

    borderWidth: number