API referenceImages

pdfGetLogMetafileSize

Read a metafile's own logical bounds rectangle (its embedded

C
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);
Delphi
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.

ParameterDescription
IPDFAccepted but not consulted for document state.
FileName / Buffer,BufSizeThe metafile to inspect.
ROutput: 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)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Images
Category

Getters

Exported names

pdfGetLogMetafileSize pdfGetLogMetafileSizeA pdfGetLogMetafileSizeW

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.