<?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 Re: My &amp;quot;ExportToPDF&amp;quot; Python scripts no longer work in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/my-quot-exporttopdf-quot-python-scripts-no-longer/m-p/833546#M3271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are bugs, like&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://support.esri.com/en/bugs/nimbus/TklNMDYyMTc3" title="https://support.esri.com/en/bugs/nimbus/TklNMDYyMTc3"&gt;NIM062177: ExportToPDF using arcpy does not export a layer attr..&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but none specifically targeted to 10.6&lt;/P&gt;&lt;P&gt;Perhaps the code might reveal something&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2018 01:07:06 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-10-03T01:07:06Z</dc:date>
    <item>
      <title>My "ExportToPDF" Python scripts no longer work</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/my-quot-exporttopdf-quot-python-scripts-no-longer/m-p/833545#M3270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have some Python scripts that export MXDs to PDFs. I initially created the scripts when we were using ArcGIS 10.5.x and they worked just fine - no errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We recently upgraded to 10.6.1 and now the scripts blow up with the following errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Traceback (most recent call last):
&amp;nbsp; File "T:\Export-pdf-KY-1-of-1.py", line 45, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; jpeg_compression_quality=vExportJpgCompression)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\utils.py", line 182, in fn_
&amp;nbsp;&amp;nbsp;&amp;nbsp; return fn(*args, **kw)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\mapping.py", line 1156, in ExportToPDF
&amp;nbsp;&amp;nbsp;&amp;nbsp; layout.exportToPDF(*args)
AttributeError: PageLayoutObject: Error in executing ExportToPDF&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've triple-checked to make sure there are no syntax errors, misspellings, or other errors in my scripts. Like I said, they used to work perfectly in 10.5.x, but not now in 10.6.1. I looked at the code in the Python scripts that are mentioned in the error message above, but I have no idea what to look for to try to fix the issue with my ExportToPDF scripts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/my-quot-exporttopdf-quot-python-scripts-no-longer/m-p/833545#M3270</guid>
      <dc:creator>ScottMcGee4</dc:creator>
      <dc:date>2021-12-12T16:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: My "ExportToPDF" Python scripts no longer work</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/my-quot-exporttopdf-quot-python-scripts-no-longer/m-p/833546#M3271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are bugs, like&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://support.esri.com/en/bugs/nimbus/TklNMDYyMTc3" title="https://support.esri.com/en/bugs/nimbus/TklNMDYyMTc3"&gt;NIM062177: ExportToPDF using arcpy does not export a layer attr..&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but none specifically targeted to 10.6&lt;/P&gt;&lt;P&gt;Perhaps the code might reveal something&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2018 01:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/my-quot-exporttopdf-quot-python-scripts-no-longer/m-p/833546#M3271</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-10-03T01:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: My "ExportToPDF" Python scripts no longer work</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/my-quot-exporttopdf-quot-python-scripts-no-longer/m-p/833547#M3272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Same issue here exporting a series of mxds to pdf containing data driven pages. I had a script that worked&amp;nbsp;great in 10.5. Now on 10.6 they dont work at all. Interestingly, if I&amp;nbsp;copy the same script over to our ArcGIS server (also with 10.6 and Python 2.7.14) and run through task manager, everything works again.&amp;nbsp;On Desktop I get 8 pages of the first mxd map series&amp;nbsp;exported out as my temp.pdf before the crash. Script/Traceback error below if anyone has any ideas:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Script Running from IDLE using Python 2.7.14 MSC v.1500 32 bit (Intel)] on win32&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;import sys, arcpy, os, string&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;mxdlist = ['Map1','Map2', 'Map3']&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;for m in mxdlist:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; ### Create Empty PDF file that will hold individual maps&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; finalPdf = arcpy.mapping.PDFDocumentCreate(r"C:\\folder\\" + m + ".pdf")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;### Define location of the mxd&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; mxd = arcpy.mapping.MapDocument(r"C:\\Folder\\" + m + ".mxd")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;tmpPdf = r"C:\\Folder\\Temp.pdf"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; ddp = mxd.dataDrivenPages&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; ddp.exportToPDF(tmpPdf, "ALL")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; finalPdf.appendPages(tmpPdf)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;del mxd, tmpPdf, finalPdf&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;os.remove("C:\\Folder\\Temp.pdf")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Returns&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Traceback error: (most recent call last):&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; File "location\Script.py", line 15, in &amp;lt;module&amp;gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; ddp.exportToPDF(tmpPdf, "ALL")&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\utils.py", line 182, in fn_&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return fn(*args, **kw)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\utils.py", line 182, in fn_&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return fn(*args, **kw)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\_mapping.py", line 447, in exportToPDF&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return convertArcObjectToPythonObject(self._arc_object.exportToPDF(*gp_fixargs((out_pdf, page_range_type, page_range_string, multiple_files, resolution, image_quality, colorspace, compress_vectors, image_compression, picture_symbol, convert_markers, embed_fonts, layers_attributes, georef_info, jpeg_compression_quality, show_selection_symbology), True)))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;AttributeError: PageLayoutObject: Error in exporting pages&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 17:09:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/my-quot-exporttopdf-quot-python-scripts-no-longer/m-p/833547#M3272</guid>
      <dc:creator>AdamDaily</dc:creator>
      <dc:date>2019-01-15T17:09:52Z</dc:date>
    </item>
  </channel>
</rss>

