API referenceText

pdfSetTextExtractionScaling

Apply a coordinate scale factor to extracted-text run positions

CategoryText extraction tuning
NoteOptions is stored but not consumed — see Remarks

Purpose — Apply a coordinate scale factor to extracted-text run positions (used by the text-extraction APIs, e.g. pdfExtractText/pdfGetPageText).

Description — Multiplies every extracted run's X/EndX by Horizontal and Y/Height by Vertical before returning extracted text geometry. Values <= 0 are ignored (the corresponding axis keeps its prior scale, default 1.0).

Declarations

C
int32_t __stdcall pdfSetTextExtractionScaling(PPDF IPDF, int32_t Options, double Horizontal, double Vertical);
Delphi
function pdfSetTextExtractionScaling(const IPDF: PPDF; Options: Integer; Horizontal, Vertical: Double): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
OptionsIntegerAccepted and stored (TextExtractScaleOpts); not read anywhere else in the codebase in this build — has no observable effect.
Horizontal, VerticalDoubleScale factors applied to extracted run X/Y and width/height respectively; <= 0 leaves the corresponding axis unchanged.

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

Remarks — Only Horizontal/Vertical have a verified effect; Options is a currently-inert parameter reserved for future use.

See alsopdfSetTextExtractionWordGap

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSetTextExtractionScaling(IntPtr IPDF, int Options, double Horizontal, double Vertical);
Area
Text
Category

Setters

Exported names

pdfSetTextExtractionScaling

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.