API referenceForms

pdfGetTextFieldValue

Read a text field's current (/V) and default (/DV)

C
BOOL32 __stdcall pdfGetTextFieldValue(PPDF IPDF, uint32_t AField, const char* Value, BOOL32* ValIsUnicode, const char* DefValue, BOOL32* DefValIsUnicode);
Delphi
function pdfGetTextFieldValue(const IPDF: PPDF; AField: Cardinal; var Value: PAnsiChar; var ValIsUnicode: LongBool; var DefValue: PAnsiChar; var DefValIsUnicode: LongBool): LongBool; stdcall;

Purpose. Read a text field's current (/V) and default (/DV) values.

Description. **Value/DefValue are output-only var PAnsiChar despite their misleading const char* C declarations (the established disguised-output pattern). Both ValIsUnicode and DefValIsUnicode are always forced False** — QueryTextFieldValue only exposes a narrow (ANSI) form regardless of the field's actual stored encoding, the same one-sided-Unicode limitation already confirmed for pdfGetJavaScript (JavaScript, FDF Import, Usage Rights, and Custom Data) and pdfGetFieldMapName (Field Naming, Identity, and Flags).

Parameters.

ParameterDescription
IPDFDocument handle.
AFieldTarget field handle.
Value, DefValueOutput only.
ValIsUnicode, DefValIsUnicodeOutput: always False.

Return value. True if AField resolves; False otherwise.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Forms
Category

Getters

Exported names

pdfGetTextFieldValue

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.