Доступно с лицензией Production Mapping.
Сводка
Exports the page layout or data frame of an .mxd file to a Production Portable Document Format (PDF) file. The Production PDF exporter includes the following capabilities:
- Spot colors—Provides Spot color support using PDF, including tint control
- Overprint—Allows a color to blend with another color for CMYK or Spot colors
- Replace colors—Maps one color to another during export from ArcGIS Desktop
- Convert color spaces—Converts between RGB and CMYK color spaces, allowing PDF files to have a mix of color spaces
Описание
PDF files are designed to be consistently viewable and printable across different platforms. They are commonly used for distributing documents on the web and are becoming a standard interchange format for content delivery. ArcMap PDFs are editable in many graphics applications and retain annotation, labeling, and attribute data for map layers from the ArcMap table of contents. PDF exports from ArcMap support embedding of fonts and thus can display symbology correctly even if Esri fonts are not installed. PDF exports from ArcMap can define colors in CMYK or RGB values.
Для экспорта отдельного фрейма данных вместо целой компоновки страницы, укажите объект DataFrame для параметра data_frame. Поскольку экспорт из фрейма данных не имеет связанной страницы с информацией о высоте и ширине, необходимо указать эти значения с помощью параметров df_export_width и df_export_height.
Управление качеством графики сгенерированного изображения при экспорте компоновки страницы отличается от экспорта фрейма данных. При экспорте компоновки страницы детализация изображения управляется параметром resolution. При экспорте фрейма данных оставьте значение параметра resolution по умолчанию, и измените параметры df_export_width и df_export_height, чтобы изменить детализацию изображения. Параметры высоты и ширины напрямую управляют числом пикселей, генерирующихся в файле экспорта, и используются только при экспорте фрейма данных. Изображения с большим числом пикселей имеют большую детализацию. При экспорте большинства компоновок значения параметров, использующиеся по умолчанию, позволяют получить хорошие результаты и качественные изображения с первой попытки. При экспорте фрейма данных необходимо попробовать различные значения параметров df_export_width и df_export_height, чтобы получить подходящий вариант.
Refer to Exporting to Production PDF in ArcGIS Help for more detailed discussions on exporting maps.
Синтаксис
ExportToProductionPDF (map_document, out_pdf, setting_file, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {image_quality}, {colorspace}, {compress_vectors}, {image_compression}, {picture_symbol}, {convert_markers}, {embed_fonts}, {layers_attributes}, {georef_info}, {jpeg_compression_quality}, {clip_to_graphics_extent}, {concatenate_characters})
Параметр | Объяснение | Тип данных |
map_document | A variable that references a MapDocument object. | MapDocument |
out_pdf | A string that represents the path and file name for the output export file. | String |
setting_file | A path to a file that contains the Production PDF settings to be used when the PDF is generated. The settings file includes the height, width, resolution, color mapping information, and other properties. | String |
data_frame | A variable that references a DataFrame object. Use PAGE_LAYOUT to export the map document's page layout instead of an individual data frame. (Значение по умолчанию — PAGE_LAYOUT) | DataFrame |
df_export_width | A number that defines the width of the export image in pixels for a data frame export; df_export_width is only used when exporting a data frame. Exporting a page layout uses the map document page width instead of df_export_width. (Значение по умолчанию — None) | Integer |
df_export_height | A number that defines the height of the export image in pixels for a data frame export; df_export_height is only used when exporting a data frame. Exporting a page layout uses the map document page height instead of df_export_height. (Значение по умолчанию — None) | Integer |
resolution | A number that defines the resolution of the export file in dots per inch (DPI). (Значение по умолчанию — None) | Integer |
image_quality | A string that defines output image quality, the draw resolution of map layers that draw as rasters.
(Значение по умолчанию — None) | String |
colorspace | A string that defines the color space of the export file. Valid values are CYMK and RGB.
(Значение по умолчанию — None) | String |
compress_vectors | A Boolean that controls compression of vector and text portions of the output file. Image compression is defined separately. (Значение по умолчанию — None) | Boolean |
image_compression | A string that defines the compression scheme used to compress image or raster data in the output file.
(Значение по умолчанию — None) | String |
picture_symbol | A string that defines whether picture markers and picture fills will be converted to vector or rasterized on output.
(Значение по умолчанию — None) | String |
convert_markers | A Boolean that controls the conversion of character-based marker symbols to polygons. This allows the symbols to appear correctly if the symbol font is not available or cannot be embedded; however, setting this parameter to True disables font embedding for all character-based marker symbols, which can result in a change in their appearance. (Значение по умолчанию — None) | Boolean |
embed_fonts | A Boolean that controls the embedding of fonts in the export file. Font embedding allows text and character markers to be displayed correctly when the document is viewed on a computer that does not have the necessary fonts installed. (Значение по умолчанию — None) | Boolean |
layers_attributes | A string that controls inclusion of PDF layer and PDF object data (attributes) in the export file.
(Значение по умолчанию — None) | String |
georef_info | A Boolean that enables the export of coordinate system information for each data frame into the output PDF file. (Значение по умолчанию — None) | Boolean |
jpeg_compression_quality | A number that controls compression quality value when image_compression is set to ADAPTIVE or JPEG. The valid range is 1 to 100. A jpeg_compression_quality of 100 provides the best quality images but creates large export files. The recommended range is between 70 and 90. (Значение по умолчанию — None) | Integer |
clip_to_graphics_extent | A Boolean that controls the clipping of output to the extent of the graphics on the page layout. It is used only when exporting a page layout. | Boolean |
concatenate_characters | A Boolean that controls the export of text as strings or individual characters. (Значение по умолчанию — False) | Boolean |
Пример кода
ExportToProductionPDF example 1
This script opens a map document and exports the page layout to a Production PDF file using default values for all options.
import arcpy
import arcpyproduction
# Check out Production Mapping license
arcpy.CheckOutExtension("foundation")
# Define variables
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
settings = r"C:\Project\RGBtoCMYKwOverPrint.xml"
# Export to Production PDF using only the required parameters
arcpyproduction.mapping.ExportToProductionPDF(mxd,
r"C:\Project\Output\Project.pdf", settings)
# Check in extension
arcpy.CheckInExtension('foundation')
ExportToProductionPDF example 2
This script will export multiple map documents using the same settings file. The PDFs are generated with file names that match the source MXDs.
import os
import arcpy
import arcpyproduction
# Check out Production Mapping license
arcpy.CheckOutExtension("foundation")
# Define variables
mxds = [r"C:\Project\Project1.mxd", r"C:\Project\Project2.mxd",
r"C:\Project\Project3.mxd"]
opath = r"C:\Project\PDF"
settings = r"C:\Project\Export_Settings\RGBtoCMYKwOverPrint.xml"
# Export multiple MXDs to Production PDF using the same settings file
for i, mxd in enumerate(mxds):
map = arcpy.mapping.MapDocument(mxds[i])
o_pdf = os.path.join(opath,
os.path.basename(os.path.splitext(mxd)[0]) + ".pdf")
print i
print "mxd=" + map.filePath
print "setfile=" + settings
print "start"
arcpyproduction.mapping.ExportToProductionPDF(map, o_pdf ,settings)
print "done" + o_pdf
# Check in extension
arcpy.CheckInExtension('foundation')