API referenceText

pdfSetTextUnderlineDistance

Set the underline's vertical offset below the text baseline.

CategoryText decoration

Purpose — Set the underline's vertical offset below the text baseline.

Declarations

C
int32_t __stdcall pdfSetTextUnderlineDistance(PPDF IPDF, double UnderlineDistance);
Delphi
function pdfSetTextUnderlineDistance(const IPDF: PPDF; UnderlineDistance: Double): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
UnderlineDistanceDoublePoints below baseline. 0 (the sentinel, not a literal zero-offset) falls back to fontSize × 0.10 at draw time.

Return value1 on a valid handle; 0 on an invalid handle.

Remarks — Because 0 is treated as "unset" rather than "flush with the baseline," you cannot position the underline exactly on the baseline through this call — the closest you can get is a very small nonzero value.

See alsopdfSetTextUnderlineWidth

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetTextUnderlineDistance(IntPtr IPDF, double UnderlineDistance);
Area
Text
Category

Setters

Exported names

pdfSetTextUnderlineDistance

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.