API referenceForms

pdfCreateTextField

Create a text (/FT /Tx) form field.

C
int32_t __stdcall pdfCreateTextField(PPDF IPDF, const char* Name, int32_t Parent, int32_t Multiline, int32_t MaxLen, double PosX, double PosY, double Width, double Height);
Delphi
function pdfCreateTextField(const IPDF: PPDF; const Name: PAnsiChar; Parent, Multiline, MaxLen: Integer; PosX, PosY, Width, Height: Double): Integer; stdcall;

Purpose. Create a text (/FT /Tx) form field.

Parameters.

ParameterDescription
IPDFDocument handle.
NameField name (/T).
ParentAccepted but silently dropped — see the chapter-wide note.
MultilineNon-zero for a multiline text field.
MaxLenMaximum character length (0 = unlimited).
PosX, PosY, Width, HeightPlacement box.

Return value. The new field's handle; 0 if IPDF is invalid.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfCreateTextField(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string Name, int Parent, int Multiline, int MaxLen, double PosX, double PosY, double Width, double Height);
Area
Forms
Category

Object Creation

Exported names

pdfCreateTextField

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.