API referenceText

pdfSetTextShader

Nominally: associate a named shading pattern with subsequent

CategoryText decoration
Exported namespdfSetTextShaderA, pdfSetTextShaderW, pdfSetTextShader
AvailabilityNon-functional (write-only) — see the chapter note above

Purpose — Nominally: associate a named shading pattern with subsequent text fills.

Description — accepted but not applied. Stores ShaderName into FTextShaderName and always returns 1. That field is never consulted anywhere else in the codebase — no writer applies it to any content stream. Calling this API has no observable effect on output.

Declarations

C
int32_t __stdcall pdfSetTextShader(PPDF IPDF, const char* ShaderName);
int32_t __stdcall pdfSetTextShaderA(PPDF IPDF, const char* ShaderName);
int32_t __stdcall pdfSetTextShaderW(PPDF IPDF, const wchar_t* ShaderName);
Delphi
function pdfSetTextShaderA(const IPDF: PPDF; ShaderName: PAnsiChar): Integer; stdcall; external 'LumasPdf.dll';
function pdfSetTextShaderW(const IPDF: PPDF; ShaderName: PWideChar): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
ShaderNamestringAccepted and stored; has no effect on output.

Return value — Always 1 on a valid handle; 0 on an invalid handle. The success return gives no indication of the no-op behavior.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetTextShaderW(IntPtr IPDF, IntPtr ShaderName);
public static extern int pdfSetTextShader(IntPtr IPDF, IntPtr ShaderName);
public static extern int pdfSetTextShaderA(IntPtr IPDF, IntPtr ShaderName);
Area
Text
Category

Setters

Exported names

pdfSetTextShaderW pdfSetTextShader pdfSetTextShaderA

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.