Skip to main content

GetValue

Gets field value

Syntax

expression.GetValue();

expression - A variable that represents a ApiBaseField class.

Parameters

This method doesn't have any parameters.

Returns

string

Example

Get value from first text field and set to second text field in a PDF document.

// How can I get the value using a base field in a PDF document?

// Get the value for a base field in a PDF document.

let doc = Api.GetDocument();
let page = doc.GetPage(0);

let textField1 = Api.CreateTextField([10, 10, 160, 30]);
let textField2 = Api.CreateTextField([10, 40, 160, 60]);

page.AddObject(textField1);
page.AddObject(textField2);

textField1.SetValue('Name Surname');
textField2.SetValue(textField1.GetValue());