API referenceText

pdfSetTextExtractionWordGap

Set the horizontal gap threshold (in text-space units) above

CategoryText extraction tuning

Purpose — Set the horizontal gap threshold (in text-space units) above which the text-extraction routines insert a space between two adjacent runs that don't already have one.

Description — Consumed by the run-to-text assembler (RunsToText) used by the extraction APIs; confirmed live (not a stored-only field) by tracing its two call sites in the extraction path.

Declarations

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

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
NewWordGapDoubleGap threshold in text-space units above which a synthetic space is inserted between runs during extraction.

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

See alsopdfSetTextExtractionScaling

C# (P/Invoke)

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

Setters

Exported names

pdfSetTextExtractionWordGap

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.