<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Batch export to PDF - no improvement in 10? in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/batch-export-to-pdf-no-improvement-in-10/m-p/313205#M3297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Back in 2008 when writing a batch export mxd to PDF tool using VBA, I noticed the tool will eventually crash ArcMap when run on a large number of maps (depending on complexity, it may take ~30 to ~60 maps that we deal with on a daily basis). In addition, graphic elements stored in the mxd instead of a feature class sometimes were not exported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the response from ESRI regarding the crash part from 2008:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;the reason behind the error, you are getting in ArcMap is because of a GDI Object leak in exportPDF class. There is a limit to the number of GDI Objects a running process in Windows can create...&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the new mapping module of arcpy, I tested the below Python scripts, given its simplicity over an Add-in. To my disappointment, the scripts crashed ArcMap after exporting 90 some maps. The problem of some mxd graphic elements not exporting was observed as well. Does anyone know if this is still a problem of the underlying ArcObjects, or I am missing something here? Thanks a lot!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to send in the error report, but it failed twice in a row. I'm attaching it here in case any ESRI rep will look at this post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[scripts:]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import os&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import string&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxdFileList=string.split(arcpy.GetParameterAsText(0), ";")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pdfPath=arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for mxdFile in mxdFileList:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; mxdFileBname=os.path.basename(mxdFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pdfFile=pdfPath+"\\"+os.path.splitext(mxdFileBname)[0] + ".pdf"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; arcpy.AddMessage("Exporting "+ pdfFile+" ...")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, pdfFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; del mxd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Oct 2011 19:37:05 GMT</pubDate>
    <dc:creator>YukunXing</dc:creator>
    <dc:date>2011-10-31T19:37:05Z</dc:date>
    <item>
      <title>Batch export to PDF - no improvement in 10?</title>
      <link>https://community.esri.com/t5/mapping-questions/batch-export-to-pdf-no-improvement-in-10/m-p/313205#M3297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Back in 2008 when writing a batch export mxd to PDF tool using VBA, I noticed the tool will eventually crash ArcMap when run on a large number of maps (depending on complexity, it may take ~30 to ~60 maps that we deal with on a daily basis). In addition, graphic elements stored in the mxd instead of a feature class sometimes were not exported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the response from ESRI regarding the crash part from 2008:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;the reason behind the error, you are getting in ArcMap is because of a GDI Object leak in exportPDF class. There is a limit to the number of GDI Objects a running process in Windows can create...&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the new mapping module of arcpy, I tested the below Python scripts, given its simplicity over an Add-in. To my disappointment, the scripts crashed ArcMap after exporting 90 some maps. The problem of some mxd graphic elements not exporting was observed as well. Does anyone know if this is still a problem of the underlying ArcObjects, or I am missing something here? Thanks a lot!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to send in the error report, but it failed twice in a row. I'm attaching it here in case any ESRI rep will look at this post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[scripts:]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import os&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import string&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mxdFileList=string.split(arcpy.GetParameterAsText(0), ";")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pdfPath=arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for mxdFile in mxdFileList:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; mxdFileBname=os.path.basename(mxdFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pdfFile=pdfPath+"\\"+os.path.splitext(mxdFileBname)[0] + ".pdf"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; arcpy.AddMessage("Exporting "+ pdfFile+" ...")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, pdfFile)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; del mxd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 19:37:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/batch-export-to-pdf-no-improvement-in-10/m-p/313205#M3297</guid>
      <dc:creator>YukunXing</dc:creator>
      <dc:date>2011-10-31T19:37:05Z</dc:date>
    </item>
  </channel>
</rss>

