Export to PDF drops graphics

30826
14
03-31-2011 12:04 PM
TereseRowekamp
New Contributor III
On my layout I have a couple of graphic files (jpgs) I've added to the layout. When I export to pdf, the graphics are dropped from the pdf file that is created (that part of the layout is just blank). This is an mxd I have successfully exported to pdf in the past, but doesn't work now in either 9.3 or 10.

Ideas?
Tags (2)
0 Kudos
14 Replies
Martinvon_Wyss
New Contributor

Six years later and it's still not working. I've tried everything to export a TIF. Sigh.

0 Kudos
CrystalMcDermott1
New Contributor II

ArcGIS 10.5 and this problem is still unsolved!? Why?

0 Kudos
MattWilkie3
Occasional Contributor II

This sounds relevant: bug NIM003653, dating back to v9.2 (2006), citing upstream limitation of Microsoft GDI sub-system.

The recommended response is to a) increase default printer page size or b) print from ArcGIS Pro instead which doesn't rely on the same export mechanism. Be aware that font substitution fall back does not happen (boxes may show for unsupported characters).

More details in knowledge base article Bug: Picture symbol legend patches, inserted images, and objects fail to draw when exported to PDF, ... 

When images or objects (such as JPEGs, BMP files, or Excel spreadsheets) are inserted in an ArcMap layout with a page size that is larger than the default printer's default page size, they fail to draw or draw incorrectly when exported. Picture marker symbols, or areas with a picture fill, may also fail to render properly on export. Legend patches of web map service layers may become pixelated or fail to draw on export, as well.

Note: At ArcGIS version 9.2 and later, picture marker symbols that are converted to vector with the 'Vectorize layers with bitmap markers/fills' option may also fail to render properly outside of the default printer's default page size. Additionally, certain cartographic representations that draw as an inserted EMF can also be affected by this issue.

Cause

If the inserted object, image, or legend patch falls outside the default page size of the Windows default printer, Windows GDI drawing calls used by ArcMap may not properly draw the object or image on output.

ElezaKollannur
New Contributor II

One workaround is to 'import Map' to ArcPro and 'Share' > Layout to pdf. This worked well for me. I noticed slight change in some of the inserted picture dimensions. otherwise it worked out well. 

0 Kudos
FelipeHerrerias
New Contributor

For anyonbe still looking, I've had some success running the following script from ArcCatalog with ArcMap closed, to convert the .mxd to PDF...

 

"""
Batch Export and Print
  This script takes MXD files
  and exports all the maps as selected
 
  @author Steven Porter
  @contact: porters1@ohio.edu
  @organization: The Voinovich School for Leadership and Public Affairs, Ohio University
  @version 1/20/11
"""
 
import arcpy, sys, os
 
#Input variables. Remember arcgis passes lists as semicolon delimited strings (files)
files= sys.argv[1]
yesPDF = sys.argv[2]
yesJPG = sys.argv[3]
yesPNG = sys.argv[4]
yesEMF = sys.argv[5]
yesAI = sys.argv[6]
yesPRINT = sys.argv[7]
printer = sys.argv[8] #relies on code to generate a list in the tool itself
outputFolder = sys.argv[9]
mergePDF = sys.argv[10]
res = sys.argv[11]
 
#if outputFolder is empty use mxd location
if outputFolder=="#":
outputFolder = os.path.dirname(files.split(";")[0])
 
if yesPDF=="true" and mergePDF =="true":
combinedpdf = arcpy.mapping.PDFDocumentCreate(outputFolder + os.sep + "CombinedMaps.pdf")
 
#loop through each passed mxd file split the string back into the list
for file in files.split(";"):
file=file.strip("'")
 
 
#parse out the file name of the file 
filename = os.path.basename(file)
 
#get the name of file without any file extension
mxd_name = filename.split(".")[0]
#create a map object from the file
map = arcpy.mapping
map_document = map.MapDocument(file)
 
#Check for broken data sources
brokenList = arcpy.mapping.ListBrokenDataSources(map_document)
if brokenList:
errorString = filename+" has broken data sources on layer(s): "
for item in brokenList:
errorString = errorString + "'"+item.name+"'"
arcpy.AddError(errorString)
 
# Set all the parameters as variables here:
data_frame = 'PAGE_LAYOUT'
resolution = res
image_quality = "NORMAL"
colorspace = "RGB"
compress_vectors = "True"
image_compression = "DEFLATE"
picture_symbol = 'RASTERIZE_BITMAP'
convert_markers = "TRUE"
embed_fonts = "True"
layers_attributes = "NONE"
georef_info = "False"
 
 
 
#perform selected operations
if yesPDF=="true":
arcpy.AddMessage("Exporting: "+ filename+" as PDF")
out_pdf = outputFolder + os.sep + mxd_name+ ".pdf"
map.ExportToPDF(map_document, out_pdf, data_frame, 640, 480, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info)
if mergePDF =="true":
combinedpdf.appendPages(out_pdf)
 
if yesJPG=="true":
arcpy.AddMessage("Exporting: "+ filename+" as JPEG")
out_jpg = outputFolder + os.sep + mxd_name+ ".jpg"
map.ExportToJPEG(map_document, out_jpg)
 
if yesPNG=="true":
arcpy.AddMessage("Exporting: "+ filename+" as PNG")
out_png = outputFolder + os.sep + mxd_name+ ".png"
map.ExportToPNG(map_document, out_png, data_frame, 640, 480, resolution)
 
if yesEMF=="true":
arcpy.AddMessage("Exporting: "+ filename+" as EMF")
out_emf= outputFolder + os.sep + mxd_name+ ".emf"
map.ExportToEMF(map_document, out_emf, data_frame, 640, 480, resolution, image_quality, "#", picture_symbol, convert_markers)
 
if yesAI=="true":
arcpy.AddMessage("Exporting: "+ filename+" as AI")
out_AI= outputFolder + os.sep + mxd_name+ ".ai"
map.ExportToAI(map_document, out_AI)
 
if yesPRINT=="true":
arcpy.AddMessage("Printing: "+filename)
map.PrintMap(map_document, printer)
 
 
del map #delete the map opject
 
if yesPDF=="true" and mergePDF =="true":
combinedpdf.saveAndClose()
del combinedpdf
# This gives feedback in the script tool dialog
 
arcpy.GetMessages()
0 Kudos