<?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 Exporting DDP to field based named PDF in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/exporting-ddp-to-field-based-named-pdf/m-p/510396#M40112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First let me say I am not versed in python....with that being said I have tried many sample codes of python and have not had any luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create roughly 127,000 cover pages.&amp;nbsp; I want the pdf name to come from our PARCELNO field, for example&amp;nbsp; 0101010000001000.pdf.&lt;/P&gt;&lt;P&gt;We are having no luck.&amp;nbsp; Is there not a simple way to have python choose the parcel number from the &lt;SPAN style="line-height: 1.5;"&gt;PARCELNO&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; field and export that to a pdf? I apologize in advance if this a simplistic question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/P&gt;&lt;P&gt;... for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, r"C:\Users\bpg\Desktop\\" + str(pageNum) + ".pdf")&lt;/P&gt;&lt;P&gt;... del mxd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the code exports but as 1.pdf, 2.pdf and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Set Up Data Driven Pages window I have choose PARCELNO as my Page Number from the drop down.&lt;/P&gt;&lt;P&gt;I feel like we are close any suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #e23d39;"&gt;Update&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Below is the script that correctly exported our pdf files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; arcpy &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... ddp = mxd.dataDrivenPages&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; pageNum &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; range(1, ddp.pageCount + 1):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ddp = mxd.dataDrivenPages&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ddp.currentPageID = pageNum&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... arcpy.mapping.ExportToPDF(mxd, r"U:\Bart\test\\" + ddp.pageRow.getValue(ddp.pageNameField.name) + ".pdf")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;del&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; mxd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;Just posting this in case anyone else needs the same script.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Mar 2015 13:51:28 GMT</pubDate>
    <dc:creator>BartonGriesenauer</dc:creator>
    <dc:date>2015-03-13T13:51:28Z</dc:date>
    <item>
      <title>Exporting DDP to field based named PDF</title>
      <link>https://community.esri.com/t5/python-questions/exporting-ddp-to-field-based-named-pdf/m-p/510396#M40112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First let me say I am not versed in python....with that being said I have tried many sample codes of python and have not had any luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create roughly 127,000 cover pages.&amp;nbsp; I want the pdf name to come from our PARCELNO field, for example&amp;nbsp; 0101010000001000.pdf.&lt;/P&gt;&lt;P&gt;We are having no luck.&amp;nbsp; Is there not a simple way to have python choose the parcel number from the &lt;SPAN style="line-height: 1.5;"&gt;PARCELNO&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; field and export that to a pdf? I apologize in advance if this a simplistic question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/P&gt;&lt;P&gt;... for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp; mxd.dataDrivenPages.currentPageID = pageNum&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd, r"C:\Users\bpg\Desktop\\" + str(pageNum) + ".pdf")&lt;/P&gt;&lt;P&gt;... del mxd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the code exports but as 1.pdf, 2.pdf and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Set Up Data Driven Pages window I have choose PARCELNO as my Page Number from the drop down.&lt;/P&gt;&lt;P&gt;I feel like we are close any suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #e23d39;"&gt;Update&lt;/SPAN&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Below is the script that correctly exported our pdf files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; arcpy &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... ddp = mxd.dataDrivenPages&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;for&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; pageNum &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; range(1, ddp.pageCount + 1):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ddp = mxd.dataDrivenPages&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ddp.currentPageID = pageNum&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;... arcpy.mapping.ExportToPDF(mxd, r"U:\Bart\test\\" + ddp.pageRow.getValue(ddp.pageNameField.name) + ".pdf")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 5.0pt; text-indent: -5.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: #004da8;"&gt;del&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt; mxd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Courier New'; color: black;"&gt;Just posting this in case anyone else needs the same script.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 13:51:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporting-ddp-to-field-based-named-pdf/m-p/510396#M40112</guid>
      <dc:creator>BartonGriesenauer</dc:creator>
      <dc:date>2015-03-13T13:51:28Z</dc:date>
    </item>
  </channel>
</rss>

