<?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: Naming a created PDF with the DDP title in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/naming-a-created-pdf-with-the-ddp-title/m-p/5502#M498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a title set under File--&amp;gt;Map Document Properties or is it empty? Do you use characters in your Title other than letters and numbers or underscores?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, in the string you have build to save the file to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;r"C:\MappingTemp\temp_pdfs\North_" + \ str(pgNumLeft) + "_FAC.pdf"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Remove the backslash after your first concantenation (+). So:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;r"C:\MappingTemp\temp_pdfs\North_" + str(pgNumLeft) + "_FAC.pdf"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 May 2014 21:48:10 GMT</pubDate>
    <dc:creator>MikeMacRae</dc:creator>
    <dc:date>2014-05-08T21:48:10Z</dc:date>
    <item>
      <title>Naming a created PDF with the DDP title</title>
      <link>https://community.esri.com/t5/python-questions/naming-a-created-pdf-with-the-ddp-title/m-p/5501#M497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good Day,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok so first I'm a very fresh beginner to Python and using it to help automate my map book creation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I am looking to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have several mxd files (one for left page, one for right page). I can currently use python to export each page in the map book, using DataDriven pages, to a pdf for each page. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm looking for a way to tell my stand alone script to name each page dependent on the name being used to sort the data driven pages.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mxdPathLeft = r"C:\MappingTemp\NorthFAC.mxd" tempMapLeft = arcpy.mapping.MapDocument(mxdPathLeft) tempDDPLeft = tempMapLeft.dataDrivenPages&amp;nbsp; # Loop creates individual pdf's for odd numbered pages # for pgNumLeft in range(1, tempDDPLeft.pageCount + 1): &amp;nbsp; temp_filename = r"C:\MappingTemp\temp_pdfs\North_" + \ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; str(pgNumLeft) + "_FAC.pdf" &amp;nbsp; if os.path.exists(temp_filename): &amp;nbsp;&amp;nbsp;&amp;nbsp; os.remove(temp_filename) &amp;nbsp; tempDDPLeft.exportToPDF(temp_filename, "RANGE", pgNumLeft)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is what I have for naming the files currently. I though I could just change the str(pgNumLeft) to str(tempMapLeft.title) but it just causes the script to hang and not do anything.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2014 16:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/naming-a-created-pdf-with-the-ddp-title/m-p/5501#M497</guid>
      <dc:creator>ThomasKendall</dc:creator>
      <dc:date>2014-05-08T16:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Naming a created PDF with the DDP title</title>
      <link>https://community.esri.com/t5/python-questions/naming-a-created-pdf-with-the-ddp-title/m-p/5502#M498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a title set under File--&amp;gt;Map Document Properties or is it empty? Do you use characters in your Title other than letters and numbers or underscores?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, in the string you have build to save the file to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;r"C:\MappingTemp\temp_pdfs\North_" + \ str(pgNumLeft) + "_FAC.pdf"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Remove the backslash after your first concantenation (+). So:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;r"C:\MappingTemp\temp_pdfs\North_" + str(pgNumLeft) + "_FAC.pdf"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2014 21:48:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/naming-a-created-pdf-with-the-ddp-title/m-p/5502#M498</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2014-05-08T21:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Naming a created PDF with the DDP title</title>
      <link>https://community.esri.com/t5/python-questions/naming-a-created-pdf-with-the-ddp-title/m-p/5503#M499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mike,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. My problem was that there was no title in the document properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I have explained what I was looking for incorrectly though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want the page name from the data driven pages to be the name of my pdf file. Similar to if you used the export map option in ArcGIS to export data driven pages.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 12:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/naming-a-created-pdf-with-the-ddp-title/m-p/5503#M499</guid>
      <dc:creator>ThomasKendall</dc:creator>
      <dc:date>2014-05-09T12:57:53Z</dc:date>
    </item>
  </channel>
</rss>

