Widget

Emits a signature field's widget annotation (/Subtype /Widget, /FT /Sig).

Table of contents

Namespace: Com\Tecnick\Pdf\Sign\Output

final class Widget

Source: src/Output/Widget.php:40

Emits a signature field’s widget annotation (/Subtype /Widget, /FT /Sig). The same shape serves the signed field (with a /V reference to the /Sig value object) and the reserved empty approval fields (no /V). The rectangle, the page object number, and any appearance fragment are computed by the host, which knows the page geometry and appearance resources.

Methods

annotation()

Emit a signature widget annotation object.

public annotation(
    int $objectId,
    string $rect,
    int $pageObjectId,
    string $fieldName,
    int|null $valueObjectId = null,
    string $appearance = '',
    callable|null $stringEncoder = null
): string

Parameters:

  • $objectId (int): Annotation object number.
  • $rect (string): Rectangle coordinates “x0 y0 x1 y1”.
  • $pageObjectId (int): Object number of the page the widget is on (/P).
  • $fieldName (string): Partial field name (/T).
  • $valueObjectId (int|null): /V value object number; null for an unsigned field.
  • $appearance (string): Optional pre-built appearance fragment (e.g. " /AS /N /AP << … »"), written into the dictionary as given, as the /Reference and /M fragments Signature takes are.
  • $stringEncoder (callable|null): fn(string $text, int $objectId): string.

Returns: string

Throws:

  • Exception: If the rectangle, an object number, or the field name is malformed, or the string encoder returns a non-string value.

Source: src/Output/Widget.php:58