ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / EPSFormat Class
Members Example

In This Topic
    EPSFormat Class
    In This Topic
    Represents an Encapsulated Postscript (EPS) object that can be used to export a MapView, MapFrame, or a Layout.
    Syntax
    public class EPSFormat : ExportFormat 
    Public Class EPSFormat 
       Inherits ExportFormat
    Remarks
    EPS files use the PostScript page description language to describe vector and raster objects. PostScript is the publishing industry standard for high-end graphics files, cartography, and printing. EPS files can be edited in many drawing applications or placed as a graphic in most page layout applications. EPS files support embedding of fonts so that users who do not have Esri Fonts installed can still view the proper symbology.
    Example
    ExportEPS_Layout
    //This example demonstrates how to export a layout to EPS.
    
    //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 ExportLayoutToEPSExample
    {
      public static Task ExportLayoutToEPSAsync(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 EPS format with appropriate settings
        EPSFormat EPS = new EPSFormat();
        EPS.Resolution = 300;
        EPS.OutputFileName = Path;
    
        return QueuedTask.Run(() =>
        {
                //Export Layout
                Layout lyt = layoutItem.GetLayout(); //Loads and returns the layout associated with a LayoutItem
                if (EPS.ValidateOutputFilePath())
          {
            lyt.Export(EPS);
          }
        });
      }
    }
    ExportEPS_MapFrame
    //This example demonstrates how to export an individual map frame on a layout to EPS.
    
    //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 ExportMapFrameToEPSExample
    {
      public static Task ExportMapFrameToEPSAsync(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 EPS format with appropriate settings
        EMFFormat EPS = new EMFFormat();
        EPS.Resolution = 300;
        EPS.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;
          EPS.OutputFileName = Path;
          if (EPS.ValidateOutputFilePath())
          {
            mf.Export(EPS);
          }
        });
      }
    }
    ExportEPS_ActiveMap
    //This example demonstrates how to export the active mapview to EPS.
    
    //Added references
    using ArcGIS.Desktop.Framework.Threading.Tasks;    //QueuedTask
    using ArcGIS.Desktop.Mapping;                      //MapView and Export formats
    
    public class ExportActiveMapToEPSExample
    {
      public static Task ExportActiveMapToEPSAsync(string Path)
      {
        return QueuedTask.Run(() =>
        {
                //Reference the active map view
                MapView mapv = MapView.Active;
    
                //Create EMF format with appropriate settings
                EPSFormat EPS = new EPSFormat();
          EPS.Resolution = 300;
          EPS.Height = 500;
          EPS.Width = 800;
          EPS.OutputFileName = Path;
    
                //Export active map view
                if (EPS.ValidateOutputFilePath())
          {
            mapv.Export(EPS);
          }
        });
      }
    }
    EPS_Constructor
    EPSFormat EPS = new EPSFormat();
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.ExportFormat
          ArcGIS.Desktop.Mapping.EPSFormat

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also