API referenceText

pdfSetTextUnderlineCustomDash

Set an arbitrary PDF dash array for the underline stroke.

CategoryText decoration

Purpose — Set an arbitrary PDF dash array for the underline stroke.

DescriptionDashPattern is written verbatim as the PDF dash-array literal (e.g. "3 2 1 2" for a dash-dot pattern) — no validation of its syntax is performed by this call; malformed input reaches the content stream as-is. Setting a custom dash clears any simple on/off dash previously set via pdfSetTextUnderlineDash (the two are mutually exclusive — last-write-wins).

Declarations

C
int32_t __stdcall pdfSetTextUnderlineCustomDash(PPDF IPDF, const char* DashPattern, double DashPhase);
int32_t __stdcall pdfSetTextUnderlineCustomDashA(PPDF IPDF, const char* DashPattern, double DashPhase);
int32_t __stdcall pdfSetTextUnderlineCustomDashW(PPDF IPDF, const wchar_t* DashPattern, double DashPhase);
Delphi
function pdfSetTextUnderlineCustomDashA(const IPDF: PPDF; DashPattern: PAnsiChar; DashPhase: Double): Integer; stdcall; external 'LumasPdf.dll';
function pdfSetTextUnderlineCustomDashW(const IPDF: PPDF; DashPattern: PWideChar; DashPhase: Double): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
DashPatternstringRaw PDF dash-array literal (space-separated numbers), not validated.
DashPhaseDoubleDash phase offset.

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

See alsopdfSetTextUnderlineDash

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetTextUnderlineCustomDashW(IntPtr IPDF, IntPtr DashPattern, double DashPhase);
public static extern int pdfSetTextUnderlineCustomDash(IntPtr IPDF, IntPtr DashPattern, double DashPhase);
public static extern int pdfSetTextUnderlineCustomDashA(IntPtr IPDF, IntPtr DashPattern, double DashPhase);
Area
Text
Category

Setters

Exported names

pdfSetTextUnderlineCustomDashW pdfSetTextUnderlineCustomDash pdfSetTextUnderlineCustomDashA

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.