pdfGetPageMetricsToString
Return a human-readable summary string of a page's
const char* __stdcall pdfGetPageMetricsToStringA(PPDF IPDF, int32_t PageNum);
const wchar_t* __stdcall pdfGetPageMetricsToStringW(PPDF IPDF, int32_t PageNum);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
PageNum | 1-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)
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);
Getters
pdfGetPageMetricsToStringW
pdfGetPageMetricsToString
pdfGetPageMetricsToStringA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.