class HexaPDF::Type::AcroForm::VariableTextField

Parent

An AcroForm variable text field defines how text that it is not known at generation time should be rendered. For example, AcroForm text fields (normally) don't have an initial value; the value is entered by the user and needs to be rendered correctly by the PDF reader.

See: PDF1.7 s12.7.3.3

Field Definitions

NameType/Allowed ValuesRequiredDefault Value
FTSymbol
One of: :Btn, :Tx, :Ch, :Sig
falsenil
ParentHexaPDF::Type::AcroForm::Field or Hashfalsenil
KidsHexaPDF::PDFArray or Arrayfalsenil
TStringfalsenil
TUStringfalsenil
TMStringfalsenil
FfIntegerfalse0
VHexaPDF::Dictionary or Symbol or String or HexaPDF::Stream or HexaPDF::PDFArray or Hash or Arrayfalsenil
DVHexaPDF::Dictionary or Symbol or String or HexaPDF::Stream or HexaPDF::PDFArray or Hash or Arrayfalsenil
AAHexaPDF::Dictionary or Hashfalsenil
DAStringfalsenil
QInteger
One of: 0, 1, 2
false0
DSStringfalsenil
RVString or HexaPDF::Stream or Hashfalsenil

Constants

INHERITABLE_FIELDS

All inheritable dictionary fields for text fields.

Public Instance Methods

parse_default_appearance_string()

Parses the default appearance string and returns an array containing [font_name, font_size].

The default appearance string is taken from the field or, if not set, the default appearance string of the form.

set_default_appearance_string(font: 'Helvetica', font_size: 0)

Sets the default appearance string using the provided values.

The default argument values are a sane default. If font_size is set to 0, the font size is calculated using the height/width of the field.

text_alignment → alignment
text_alignment(alignment) → field

Sets or returns the text alignment that should be used when displaying text.

With no argument, the current text alignment is returned. When a value is provided, the text alignment is set accordingly.

The alignment value is one of :left, :center or :right.