pdfGetLogMetafileSizeEx
Read a metafile's own logical bounds rectangle (its embedded
BOOL32 __stdcall pdfGetLogMetafileSizeA(PPDF IPDF, const char* FileName, TRectL* R);
BOOL32 __stdcall pdfGetLogMetafileSizeW(PPDF IPDF, const wchar_t* FileName, TRectL* R);
BOOL32 __stdcall pdfGetLogMetafileSizeEx(PPDF IPDF, void* Buffer, uint32_t BufSize, TRectL* R);
function pdfGetLogMetafileSizeA(const IPDF: PPDF; const FileName: PAnsiChar; var R: TRectL): LongBool; stdcall;
function pdfGetLogMetafileSizeW(const IPDF: PPDF; const FileName: PWideChar; var R: TRectL): LongBool; stdcall;
function pdfGetLogMetafileSizeEx(const IPDF: PPDF; Buffer: Pointer; BufSize: Cardinal; var R: TRectL): LongBool; stdcall;
Purpose. Read a metafile's own logical bounds rectangle (its embedded device frame), without inserting it — useful for computing an aspect- correct placement box before calling pdfInsertMetafile.
Description. A/W read the file into memory and delegate to a shared pdfGetLogMetafileSize_File file-reading helper; Ex parses the caller's buffer directly via EMFGetBounds, filling R from the parsed Left/Top/Right/Bottom extents. IPDF is accepted by all three but this is a pure file/buffer-parsing utility, not consulted for any document-specific state — same pattern as pdfGetImageCount's file- scanning variants (Image Objects and Introspection).
Parameters.
| Parameter | Description |
|---|---|
IPDF | Accepted but not consulted for document state. |
FileName / Buffer,BufSize | The metafile to inspect. |
R | Output: the metafile's logical bounds rectangle. |
Return value. True if the file/buffer parsed as a valid metafile and R was filled; False otherwise.
See also. pdfInsertMetafile.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Getters
pdfGetLogMetafileSizeEx
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.