---
Product: Aspose.PDF
Platform: go
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/go/buttonfield
---

# ButtonField

## Overview

`ButtonField` is a type in Aspose.PDF FOSS for Go.
Inherits from: `fieldBase`.

ButtonField is a push button — action only, no value semantics.

This type declares 6 methods for ButtonField objects in Go programs.
Available methods include: `Action`, `SetAction`, `SetAppearance`, `SetReadOnly`, `SetValue`, `Value`.
Public members are accessible to any Go application after installing the Aspose.PDF FOSS for Go package.

## Methods

| Signature | Description |
|-----------|-------------|
| `Action()` → `Action` | Action returns the button's activation action (/A on its widget), or nil if none is set or the action type is unsupported. |
| `SetAction(act: Action)` | SetAction writes the button's activation action (/A) onto its widget(s) — typically a SubmitFormAction, ResetFormAction, GoTo/URI or JavaScript action. |
| `SetAppearance(a: ButtonAppearance)` → `error` | SetAppearance applies a ButtonAppearance to the push button: it writes the /MK characteristics (/CA, /RC, /AC, /TP) and regenerates the widget's /AP with distinct /N (normal), /R (rollover), and /D (down) appearance streams. |
| `SetReadOnly(v: bool)` | Sets the read only value. |
| `Value()` → `string` | Returns the value. |
| `SetValue(s: string)` → `error` | Sets the value value. |

## See Also

- [Aspose.PDF — Enterprise API Reference](https://reference.aspose.com/pdf/)