API referenceText

pdfSetTextUnderline

Turn underlining on/off for subsequent text writes.

CategoryText decoration
Notescoped to pdfWriteText/Ex only, see the chapter note above

Purpose — Turn underlining on/off for subsequent text writes.

Description — Sets the global FUnderlineOn flag consulted by EmitUnderline. Default underline appearance when no other pdfSetTextUnderline* call has customized it: width = fontSize × 0.05, distance below baseline = fontSize × 0.10, solid line, color = the current text fill color.

Declarations

C
int32_t __stdcall pdfSetTextUnderline(PPDF IPDF, int32_t Underline);
Delphi
function pdfSetTextUnderline(const IPDF: PPDF; Underline: Integer): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
UnderlineInteger0 = off, non-zero = on.

Return value1 on a valid handle; 0 on an invalid handle. Cannot otherwise fail.

Remarks — Only affects text drawn via pdfWriteText/Ex — see the chapter-level note.

See alsopdfSetTextUnderlineColor, pdfSetTextUnderlineWidth

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetTextUnderline(IntPtr IPDF, int Underline);
Area
Text
Category

Setters

Exported names

pdfSetTextUnderline

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.