public class EPSFormat : ExportFormat
Public Class EPSFormat Inherits ExportFormat
public class EPSFormat : ExportFormat
Public Class EPSFormat Inherits ExportFormat
//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); } }); } }
//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); } }); } }
//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 map = 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()) { map.Export(EPS); } }); } }
System.Object
ArcGIS.Desktop.Mapping.ExportFormat
ArcGIS.Desktop.Mapping.EPSFormat
Target Platforms: Windows 10, Windows 8.1, Windows 7