DynaPDF.GetLogMetafileSize
--------------------------

Queries bounding rectangle from EMF file.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [7.3](newinversion73.md) | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |

MBS( "DynaPDF.GetLogMetafileSize"; PDF; FileName ) 

**MBS**( **"DynaPDF.GetLogMetafileSize";** /\* Queries bounding rectangle from EMF file. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$FileName**) /\* The native file path to the EMF file.e.g. "C:\\test.wmf" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| FileName | The native file path to the EMF file. | "C:\\test.wmf" |

### Result

Returns rectangle or error.

### Description

Queries bounding rectangle from EMF file.  
Retrieves the logical bounding box of an enhanced or Windows metafile. The parameter FileName must be the file path to the EMF or WMF file. Returns the unscaled logical bounding box of the metafile. This bounding box is required to calculate a user defined cutting area or viewport (see the example below the description of the function).   
Two WMF formats are available, the old non-portable WMF format and the newer portable WMF format. Both formats must be converted to EMF with the GDI function SetWinMetaFileBits() before the logical bounding box can be calculated (the conversion is done automatically). However, non- portable WMF files are device-dependent, they contain no size information. To get correct results, the default size must be set with the function [DynaPDF.SetWMFDefExtent](DynaPDFSetWMFDefExtent.md) beforehand. The parameters Width and Height are passed to the member xExt, yExt of the structure METAFILEPICT which is required to convert WMF files to EMF. The default size is 0, 0, that means the GDI calculates the size automatically but mostly incorrect.   
Because the GDI function SetWinMeatFileBits() is used to convert WMF files to EMF, WMF files are not supported under Linux or UNIX.   
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
See also [GetLogMetafileSize](https://www.monkeybreadsoftware.com/DynaPDF-Manual/GetLogMetafileSize.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.GetLogMetafileSizeEx](DynaPDFGetLogMetafileSizeEx.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetWMFDefExtent](DynaPDFSetWMFDefExtent.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

This function checks for a license.

Created 18th May 2017 , last changed 18th May 2017

  
[DynaPDF.GetLinkHighlightMode](DynaPDFGetLinkHighlightMode.md) - [DynaPDF.GetLogMetafileSizeEx](DynaPDFGetLogMetafileSizeEx.md)

[HTML Version](DynaPDFGetLogMetafileSize.shtml)