API referenceText

pdfSetTextUnderlineColorSep

Set the underline stroke color as a named Separation (spot)

CategoryText decoration
Notewith a documented fallback

Purpose — Set the underline stroke color as a named Separation (spot) color with a tint.

Description — Looks up ColorName among colorants of already-registered Separation color spaces (pdfCreateSeparationCS) at draw time. If found, the underline is stroked with a real /Separation resource reference. If no matching colorant is registered, the engine falls back to a grayscale approximation (1.0 - Tint gray) rather than failing — silent, not an error, so a typo'd ColorName produces plausible-looking gray output instead of a diagnosable failure.

Declarations

C
int32_t __stdcall pdfSetTextUnderlineColorSep(PPDF IPDF, const char* ColorName, double Tint);
int32_t __stdcall pdfSetTextUnderlineColorSepA(PPDF IPDF, const char* ColorName, double Tint);
int32_t __stdcall pdfSetTextUnderlineColorSepW(PPDF IPDF, const wchar_t* ColorName, double Tint);
Delphi
function pdfSetTextUnderlineColorSepA(const IPDF: PPDF; ColorName: PAnsiChar; Tint: Double): Integer; stdcall; external 'LumasPdf.dll';
function pdfSetTextUnderlineColorSepW(const IPDF: PPDF; ColorName: PWideChar; Tint: Double): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
ColorNamestringColorant name; must match a Separation color space registered via pdfCreateSeparationCS for a real spot color to be used.
TintDouble0.0..1.0 tint value.

Return value1 on a valid handle; 0 on an invalid handle. Does not fail when ColorName has no match — see Description.

See alsopdfCreateSeparationCS

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetTextUnderlineColorSepW(IntPtr IPDF, IntPtr ColorName, double Tint);
public static extern int pdfSetTextUnderlineColorSep(IntPtr IPDF, IntPtr ColorName, double Tint);
public static extern int pdfSetTextUnderlineColorSepA(IntPtr IPDF, IntPtr ColorName, double Tint);
Area
Text
Category

Setters

Exported names

pdfSetTextUnderlineColorSepW pdfSetTextUnderlineColorSep pdfSetTextUnderlineColorSepA

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.