<?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 export single page from data driven pages in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/export-single-page-from-data-driven-pages/m-p/540801#M42259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to create a python script that will allow export of just one page from a series of data driven pages but not having much luck.&amp;nbsp; More specifically, I have 187 data driven pages; I want to export only page 25 to .pdf.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can run a python script to export all pages, and that works great, but after making minor edits to the data that show on only page 25, I only need to export page 25--not the entire series.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone provide a script to export just the one page?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Oct 2011 18:59:22 GMT</pubDate>
    <dc:creator>JeffBaker2</dc:creator>
    <dc:date>2011-10-14T18:59:22Z</dc:date>
    <item>
      <title>export single page from data driven pages</title>
      <link>https://community.esri.com/t5/python-questions/export-single-page-from-data-driven-pages/m-p/540801#M42259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to create a python script that will allow export of just one page from a series of data driven pages but not having much luck.&amp;nbsp; More specifically, I have 187 data driven pages; I want to export only page 25 to .pdf.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can run a python script to export all pages, and that works great, but after making minor edits to the data that show on only page 25, I only need to export page 25--not the entire series.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone provide a script to export just the one page?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 18:59:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-single-page-from-data-driven-pages/m-p/540801#M42259</guid>
      <dc:creator>JeffBaker2</dc:creator>
      <dc:date>2011-10-14T18:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: export single page from data driven pages</title>
      <link>https://community.esri.com/t5/python-questions/export-single-page-from-data-driven-pages/m-p/540802#M42260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The data driven pages object has a property called currentPageID. This will allow you to you just print one page out of multiple pages for the data driven page series.&amp;nbsp; You can find more information here: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s300000030000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s300000030000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
from arcpy import mapping
from arcpy import env
import os
mxdPath = arcpy.GetParameterAsText(0)&amp;nbsp; # ex: r"c:\temp\ddpMap.mxd"
pageNum = arcpy.GetParameter(1)&amp;nbsp; # ex: 25
mxd = mapping.MapDocument(mxdPath)
ddp = mxd.dataDrivenPages
ddp.currentPageID = int(pageNum) # here you would pass 25;&amp;nbsp; casting to int() just to be safe
mapping.ExportToPDF(mxd, r"C:\test\mappage_" + str(pageNum) + ".pdf")
del mxd
del ddp
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to use the data driven page object to export maps, you can also do that as well.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#.... other logic
#
ddp = mxd.dataDrivenPages
ddp.currentPageID = int(pageNum)
ddp.exportToPDF(r"c:\temp\mypage.pdf",page_range_type="CURRENT",multiple_files="PDF_SINGLE_FILE")
#... other code
#
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know how this works out.&amp;nbsp; Hope it helps!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Enjoy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:27:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-single-page-from-data-driven-pages/m-p/540802#M42260</guid>
      <dc:creator>AndrewChapkowski</dc:creator>
      <dc:date>2021-12-11T23:27:46Z</dc:date>
    </item>
  </channel>
</rss>

