ArcGIS Pro 2.8 API Reference Guide
EMFFormat Class
Members  Example 

ArcGIS.Desktop.Mapping Namespace : EMFFormat Class
Represents an Enhanced Metafile Format (EMF) object that can be used to export a MapView, MapFrame, or a Layout.
Syntax
public class EMFFormat : ExportFormat 
Public Class EMFFormat 
   Inherits ExportFormat
Remarks
EMF files are native Windows graphics files that can contain a mixture of vector and raster data. They are useful for embedding in Windows documents because the vector portions of the EMF can be resized without loss of quality. However, since EMF does not support font embedding and is exclusively a Windows format, it is not commonly used as an interchange format between users.
Example
The following examples demonstrate how to export a Layout, a MapFrame, and a MapView to EMF format.
//This example demonstrates how to export a layout to EMF.

//Added references
using ArcGIS.Desktop.Core;                         //Project
using ArcGIS.Desktop.Layouts;                      //Layout classes
using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask
using ArcGIS.Desktop.Mapping;                     //Export formats

public class ExportLayoutToEMFExample
{
  public static Task ExportLayoutToEMFAsync(string LayoutName, string Path)
  {
    //Reference a layoutitem in a project by name
    LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(LayoutName));
    if (layoutItem == null)
      return Task.FromResult<Layout>(null);

    //Create EMF format with appropriate settings
    EMFFormat EMF = new EMFFormat();
    EMF.Resolution = 300;
    EMF.OutputFileName = Path;

    return QueuedTask.Run(() =>
    {
            //Export Layout
            Layout lyt = layoutItem.GetLayout(); //Loads and returns the layout associated with a LayoutItem
            if (EMF.ValidateOutputFilePath())
      {
        lyt.Export(EMF);
      }
    });
  }
}
//This example demonstrates how to export an individual map frame on a layout to EMF.

//Added references
using ArcGIS.Desktop.Core;                         //Project
using ArcGIS.Desktop.Layouts;                      //Layout classes
using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask
using ArcGIS.Desktop.Mapping;                      //Export formats

public class ExportMapFrameToEMFExample
{
  public static Task ExportMapFrameToEMFAsync(string LayoutName, string MFName, string Path)
  {
    //Reference a layoutitem in a project by name
    LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(LayoutName));
    if (layoutItem == null)
      return Task.FromResult<Layout>(null);

    //Create EMF format with appropriate settings
    EMFFormat EMF = new EMFFormat();
    EMF.Resolution = 300;
    EMF.OutputFileName = Path;

    return QueuedTask.Run(() =>
    {
            //Export MapFrame
            Layout lyt = layoutItem.GetLayout(); //Loads and returns the layout associated with a LayoutItem
            MapFrame mf = lyt.FindElement(MFName) as MapFrame;
      EMF.OutputFileName = Path;
      if (EMF.ValidateOutputFilePath())
      {
        mf.Export(EMF);
      }
    });
  }
}
//This example demonstrates how to export the active mapview to EMF.

//Added references
using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask
using ArcGIS.Desktop.Mapping;                      //MapView and Export formats

public class ExportActiveMapToEMFExample
{
  public static Task ExportActiveMapToEMFAsync(string Path)
  {
    return QueuedTask.Run(() =>
    {
            //Reference the active map view
            MapView map = MapView.Active;

            //Create EMF format with appropriate settings
            EMFFormat EMF = new EMFFormat();
      EMF.Resolution = 300;
      EMF.Height = 500;
      EMF.Width = 800;
      EMF.OutputFileName = Path;

            //Export active map view
            if (EMF.ValidateOutputFilePath())
      {
        map.Export(EMF);
      }
    });
  }
}
Inheritance Hierarchy

System.Object
   ArcGIS.Desktop.Mapping.ExportFormat
      ArcGIS.Desktop.Mapping.EMFFormat

Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

EMFFormat Members
ArcGIS.Desktop.Mapping Namespace