API referenceCore SDK

pdfSetCharacterSpacing

Set/get the PDF Tc (character spacing) and Tw (word

C
double __stdcall pdfGetCharacterSpacing(PPDF IPDF);
BOOL32 __stdcall pdfSetCharacterSpacing(PPDF IPDF, double Value);
double __stdcall pdfGetWordSpacing(PPDF IPDF);
BOOL32 __stdcall pdfSetWordSpacing(PPDF IPDF, double Value);
Delphi
function pdfGetCharacterSpacing(const IPDF: PPDF): Double; stdcall;
function pdfSetCharacterSpacing(const IPDF: PPDF; Value: Double): LongBool; stdcall;
function pdfGetWordSpacing(const IPDF: PPDF): Double; stdcall;
function pdfSetWordSpacing(const IPDF: PPDF; Value: Double): LongBool; stdcall;

Purpose. Set/get the PDF Tc (character spacing) and Tw (word spacing) text-state parameters.

Description. Both setters are real: they cache the value and immediately emit the corresponding Tc/Tw content-stream operator via the current content stream, taking effect on subsequently-written text.

Return value. Getters: the cached current value; 0.0 if IPDF invalid. Setters: True if there is a current content stream to write into; False otherwise.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Setters

Exported names

pdfSetCharacterSpacing

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.