NAME

PDF::Make::Builder::Form::Field::Button - Push button form field

SYNOPSIS

# Submit form data to a URL
$b->add_field(
    type       => 'button',
    name       => 'submit',
    caption    => 'Submit',
    submit_url => 'https://example.com/submit',
    w          => 100,
);

# Reset all form fields
$b->add_field(
    type       => 'button',
    name       => 'reset',
    caption    => 'Reset',
    is_reset   => 1,
    w          => 100,
);

# JavaScript action
$b->add_field(
    type       => 'button',
    name       => 'alert',
    caption    => 'Click Me',
    javascript => 'app.alert("Hello from PDF!");',
    w          => 120,
);

PROPERTIES

Inherits all properties from PDF::Make::Builder::Form::Field, plus:

caption (Str) - Button face text. Defaults to label or name.
url (Str) - URL to open when clicked (works in all PDF viewers).
submit_url (Str) - URL to submit form data to (HTML format).
is_reset (Bool, default 0) - Make this a form reset button.
javascript (Str) - JavaScript code to execute on click (requires Adobe Acrobat or compatible viewer).

Only one action type can be set per button. Priority: url > submit_url > is_reset > javascript.

SEE ALSO

PDF::Make::Builder::Form::Field, PDF::Make::Builder