EPSFormat

Synthèse

The EPSFormat object represents a collection of Encapsulated PostScript (EPS) file properties that can be configured and used with the export method on the Layout, MapFrame, and MapView objects to create an output EPS file.

Discussion

EPS format 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 format supports font embedding and can define colors in CMYK or RGB values.

The createExportFormat method can be used to create a EPSFormat object if the format parameter is set to EPS. The returned EMFFormat object contains all the properties associated with a generating a EPS file. These properties can be modified accordingly to produce different output results.

Propriétés

PropriétéExplicationType de données
clipToElements
(Lecture et écriture)

If set to True, include the areas of the page that have map or layout element content only, rather than exporting the entire page. This property only applies when exporting a Layout object. The default value is False.

Boolean
convertMarkers
(Lecture et écriture)

Controls whether marker symbols based on font characters are exported as font characters or as polygons. Set this option to True to view the output on a machine that does not have the appropriate fonts installed when you cannot embed the fonts due to licensing or file format restrictions. This does not apply to text, only marker symbols based on fonts. The default value is False.

Boolean
embedFonts
(Lecture et écriture)

Include embeddable fonts in the exported file to maintain font consistency across different platforms. Fonts that do not support embedding are not included, regardless of this setting. The default value is True.

Remarque :

To correctly edit text as graphics, Illustrator requires fonts to be installed and accessible. Check the sharing permissions before embedding and sharing fonts.

Boolean
filePath
(Lecture et écriture)

A string that represents the system path and file name, including the extension, for the exported file.

String
height
(Lecture et écriture)

The height, in pixels, of the map area to be exported. This property only applies when exporting a MapView object. The default value is 960.

Double
imageCompression
(Lecture et écriture)

The compression scheme used to compress image or raster data in the output file. The default value is DEFLATE.

  • DEFLATE Lossless compression method that works well for most cases.
  • LZW Lossless compression method using a code table.
  • NONECompression is not applied.
  • RLE Run-length encoded compression, a lossless compression method that works well if there are large areas of the same color.
String
imageQuality
(Lecture et écriture)

The amount of image resampling. The property determines the effective resolution of raster content on output. For instance, if imageQuality is set to BETTER, a resample ratio of 1:2, and the output resolution is set to 300 dpi, the raster content is output at approximately 150 dpi. In many cases, the raster data can be included at a lower dpi than the vector data without visibly affecting quality, reducing the output file size. The default value is BEST.

  • BESTAn output image quality resample ratio of 1
  • BETTERAn output image quality resample ratio of 2
  • NORMALAn output image quality resample ratio of 3
  • FASTERAn output image quality resample ratio of 4
  • FASTESTAn output image quality resample ratio of 5
String
outputAsImage
(Lecture et écriture)

Export vector content as an image. For maps or layouts containing vector layers with a high density of vertices, this can drastically reduce the output file size. The default value is False.

Remarque :

Options specific to vector data, such as embedFonts are unavailable when outputAsImage is set to True.

Boolean
resolution
(Lecture et écriture)

The effective dpi of the output vector data. The default value is 96.

Remarque :

When exporting a MapView, the dpi is calculated automatically using system dpi scaling and therefore this value will be ignored.

Integer
showSelectionSymbology
(Lecture et écriture)

Show selected features in the map or map frame as selected in the output file. Setting this value to False does not affect selection within the view, only in the output file. The default value is False.

Boolean
width
(Lecture et écriture)

The width, in pixels, of the map area to be exported. This property only applies when exporting a MapView object. The default value is 960.

Double

Vue d’ensemble des méthodes

MéthodeExplication
setImageCompression (image_compression)

A string constant that represents the compression scheme used to compress image or raster data in the output file.

setImageQuality (image_quality)

A string constant that sets the amount of image resampling.

Méthodes

setImageCompression (image_compression)
ParamètreExplicationType de données
image_compression

Below is a list of valid strings.

  • DEFLATE Lossless compression method that works well for most cases.
  • LZW Lossless compression method using a code table.
  • NONECompression is not applied.
  • RLE Run-length encoded compression, a lossless compression method that works well if there are large areas of the same color.
String
setImageQuality (image_quality)
ParamètreExplicationType de données
image_quality

Below is a list of valid strings.

  • BESTAn output image quality resample ratio of 1
  • BETTERAn output image quality resample ratio of 2
  • NORMALAn output image quality resample ratio of 3
  • FASTERAn output image quality resample ratio of 4
  • FASTESTAn output image quality resample ratio of 5
String

The value determines the effective resolution of raster content on output. For instance, if the output image quality ratio is set to 1:2, an image_quality value of BETTER, and the output resolution is set to 300 dpi, the raster content is output at approximately 150 dpi. In many cases, the raster data can be included at a lower dpi than the vector data without visibly affecting quality, reducing the output file size.

Exemple de code

EPSFormat example

The following script exports a layout to EPS format using default property values.

p = arcpy.mp.ArcGISProject('current')
lyt = p.listLayouts()[0]

eps = arcpy.mp.CreateExportFormat('EPS', r'C:\Temp\output.eps')

lyt.export(eps)