<?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: Export each page of a map series to individual PDF files in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/export-each-page-of-a-map-series-to-individual-pdf/m-p/1239038#M67817</link>
    <description>&lt;P&gt;MapSeries.exportToPdf() activates each page of the series and exports them into the same pdf. You do that process for each page.&lt;/P&gt;&lt;P&gt;What you want to do is activate each page, then export the &lt;EM&gt;layout&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject(ProProject)
try:
    msLayout = aprx.listLayouts('Neighborhoods MapBook')[0]   ## the number in brackets is the number in the layout
    print ('Layout {}'.format(msLayout.name))
    if not msLayout.mapSeries is None:
        ms = msLayout.mapSeries
        ms.refresh()
        if ms.enabled:
            for pageNum in range(1, ms.pageCount + 1):
                ms.currentPageNumber = pageNum
                pageName = ms.pageRow.NHNAME
                msLayout.exportToPDF(os.path.join(OutFolder, f"NeighborhoodsMapBook_{ms.pageRow.NHNAME}.pdf"))
                print(ms.pageRow.NHNAME + ' exported')
            
except:
    message = arcpy.GetMessages()&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 08 Dec 2022 08:02:37 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-12-08T08:02:37Z</dc:date>
    <item>
      <title>Export each page of a map series to individual PDF files</title>
      <link>https://community.esri.com/t5/python-questions/export-each-page-of-a-map-series-to-individual-pdf/m-p/1238898#M67816</link>
      <description>&lt;P&gt;I've adapted the following script to export each page of a map series to individual PDF files but it exports&lt;SPAN&gt;&amp;nbsp;the entire map series 50 times (number of pages) and updates each export name with the name of each page title.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/mapseries-class.htm" target="_blank" rel="noopener"&gt;original script exports each page to PNG file (&amp;nbsp;MapSeries example 2)&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject(ProProject)
try:
    msLayout = aprx.listLayouts('Neighborhoods MapBook')[0]   ## the number in brackets is the number in the layout
    print ('Layout {}'.format(msLayout.name))
    if not msLayout.mapSeries is None:
        ms = msLayout.mapSeries
        ms.refresh()
        if ms.enabled:
            for pageNum in range(1, ms.pageCount + 1):
                ms.currentPageNumber = pageNum
                pageName = ms.pageRow.NHNAME
                ms.exportToPDF(os.path.join(OutFolder, f"NeighborhoodsMapBook_{ms.pageRow.NHNAME}.pdf"))
                print(ms.pageRow.NHNAME + ' exported')
            
except:
    message = arcpy.GetMessages()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 20:39:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-each-page-of-a-map-series-to-individual-pdf/m-p/1238898#M67816</guid>
      <dc:creator>AliciaShyu</dc:creator>
      <dc:date>2022-12-07T20:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export each page of a map series to individual PDF files</title>
      <link>https://community.esri.com/t5/python-questions/export-each-page-of-a-map-series-to-individual-pdf/m-p/1239038#M67817</link>
      <description>&lt;P&gt;MapSeries.exportToPdf() activates each page of the series and exports them into the same pdf. You do that process for each page.&lt;/P&gt;&lt;P&gt;What you want to do is activate each page, then export the &lt;EM&gt;layout&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx = arcpy.mp.ArcGISProject(ProProject)
try:
    msLayout = aprx.listLayouts('Neighborhoods MapBook')[0]   ## the number in brackets is the number in the layout
    print ('Layout {}'.format(msLayout.name))
    if not msLayout.mapSeries is None:
        ms = msLayout.mapSeries
        ms.refresh()
        if ms.enabled:
            for pageNum in range(1, ms.pageCount + 1):
                ms.currentPageNumber = pageNum
                pageName = ms.pageRow.NHNAME
                msLayout.exportToPDF(os.path.join(OutFolder, f"NeighborhoodsMapBook_{ms.pageRow.NHNAME}.pdf"))
                print(ms.pageRow.NHNAME + ' exported')
            
except:
    message = arcpy.GetMessages()&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 08 Dec 2022 08:02:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-each-page-of-a-map-series-to-individual-pdf/m-p/1239038#M67817</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-12-08T08:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Export each page of a map series to individual PDF files</title>
      <link>https://community.esri.com/t5/python-questions/export-each-page-of-a-map-series-to-individual-pdf/m-p/1239683#M67818</link>
      <description>&lt;P&gt;Thanks Johannes!!&lt;/P&gt;&lt;P&gt;The script now exports each page but it stops at page 25&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Map Series- ArcGIS Pro.png" style="width: 327px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58153i93D19018C4AE4921/image-size/large?v=v2&amp;amp;px=999" role="button" title="Map Series- ArcGIS Pro.png" alt="Map Series- ArcGIS Pro.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea why it's doing that?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 17:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-each-page-of-a-map-series-to-individual-pdf/m-p/1239683#M67818</guid>
      <dc:creator>AliciaShyu</dc:creator>
      <dc:date>2022-12-09T17:13:40Z</dc:date>
    </item>
  </channel>
</rss>

