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

    Class CPDFWidget

    Base class for form widgets, storing essential form information.

    This class represents a form widget in a PDF document, containing basic attributes such as type, title, and the page it appears on. The fromJson method allows converting JSON data into form widget objects.

    CPDFWidget

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • 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<CPDFWidget, "createDate" | "update" | "toJSON"> & {
          createDate?: number;
          borderColor: string;
          fillColor: string;
          borderWidth: number;
      }

    • Update widget properties in a type-safe way

      Parameters

      • updates: Partial<Omit<this, "type" | "page" | "uuid" | "createDate">>

        Partial object containing properties to update

      Returns this

      this instance for chaining

      widget.update({ title: 'New Title', fillColor: '#FF0000', borderColor: '#00FF00' });
      await document.updateWidget(widget);

    Properties

    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