API referenceCore SDK

pdfGetPageMetricsToString

Return a human-readable summary string of a page's

C
const char* __stdcall pdfGetPageMetricsToStringA(PPDF IPDF, int32_t PageNum);
const wchar_t* __stdcall pdfGetPageMetricsToStringW(PPDF IPDF, int32_t PageNum);
Delphi
function pdfGetPageMetricsToStringA(const IPDF: PPDF; PageNum: Integer): PAnsiChar; stdcall;
function pdfGetPageMetricsToStringW(const IPDF: PPDF; PageNum: Integer): PWideChar; stdcall;

Purpose. Return a human-readable summary string of a page's dimensions — "Width=%.2f Height=%.2f Rotation=%d".

Description. The Rotation field in the formatted output is hardcoded to 0 unconditionally; the page's actual rotation value is never read or substituted, regardless of what pdfSetPageOrientation (Page Lifecycle and Geometry) may have set for that page. A caller parsing this string for rotation will always see 0.

Parameters.

ParameterDescription
IPDFDocument handle.
PageNum1-based target page.

Return value. The formatted string (transient buffer); an empty string if PageNum doesn't resolve; nil if IPDF is invalid.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetPageMetricsToStringW(IntPtr IPDF, int PageNum);
public static extern IntPtr pdfGetPageMetricsToString(IntPtr IPDF, int PageNum);
public static extern IntPtr pdfGetPageMetricsToStringA(IntPtr IPDF, int PageNum);
Area
Core SDK
Category

Getters

Exported names

pdfGetPageMetricsToStringW pdfGetPageMetricsToString pdfGetPageMetricsToStringA

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.