API referenceCore SDK

pdfGetAscent

Read the current font's ascent/descent/cap-height metrics

C
double __stdcall pdfGetAscent(PPDF IPDF);
double __stdcall pdfGetDescent(PPDF IPDF);
double __stdcall pdfGetCapHeight(PPDF IPDF);
int32_t __stdcall pdfGetIsFixedPitch(PPDF IPDF);
Delphi
function pdfGetAscent(const IPDF: PPDF): Double; stdcall;
function pdfGetDescent(const IPDF: PPDF): Double; stdcall;
function pdfGetCapHeight(const IPDF: PPDF): Double; stdcall;
function pdfGetIsFixedPitch(const IPDF: PPDF): Integer; stdcall;

Purpose. Read the current font's ascent/descent/cap-height metrics and fixed-pitch (monospace) flag, all as fractions of the font's own em-square (typically scaled by the caller against the active font size).

Return value. The respective metric; 0.0/0 if IPDF is invalid or no font is currently selected.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern double pdfGetAscent(IntPtr IPDF);
Area
Core SDK
Category

Getters

Exported names

pdfGetAscent

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.