<?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 Refresh Map during export layout as PDF using python script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1507571#M71096</link>
    <description>&lt;P&gt;I have a python script that querying some values and appending them to Layout. I'm applying symbology, labeling, and definition query. the script running well, but when exporting to PDF the symbology and labeling don't appears.&lt;/P&gt;&lt;P&gt;Although when I zoom in or out from the layout all appears.&lt;/P&gt;&lt;P&gt;the first image from the map&amp;nbsp;(with labeling &amp;amp;symbology)&lt;BR /&gt;the second image from the layout (without labeling &amp;amp;symbology)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="First Image" style="width: 315px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110145iACF7231251E37FF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MohamedHassan17_1-1721499082466.png" alt="First Image" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;First Image&lt;/span&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="second image" style="width: 267px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110147iD17109DB1AF490E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MohamedHassan17_3-1721499307537.png" alt="second image" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;second image&lt;/span&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&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;&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>Sun, 21 Jul 2024 11:52:55 GMT</pubDate>
    <dc:creator>MohamedHassan17</dc:creator>
    <dc:date>2024-07-21T11:52:55Z</dc:date>
    <item>
      <title>Refresh Map during export layout as PDF using python script</title>
      <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1507571#M71096</link>
      <description>&lt;P&gt;I have a python script that querying some values and appending them to Layout. I'm applying symbology, labeling, and definition query. the script running well, but when exporting to PDF the symbology and labeling don't appears.&lt;/P&gt;&lt;P&gt;Although when I zoom in or out from the layout all appears.&lt;/P&gt;&lt;P&gt;the first image from the map&amp;nbsp;(with labeling &amp;amp;symbology)&lt;BR /&gt;the second image from the layout (without labeling &amp;amp;symbology)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="First Image" style="width: 315px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110145iACF7231251E37FF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MohamedHassan17_1-1721499082466.png" alt="First Image" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;First Image&lt;/span&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="second image" style="width: 267px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110147iD17109DB1AF490E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MohamedHassan17_3-1721499307537.png" alt="second image" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;second image&lt;/span&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&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;&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>Sun, 21 Jul 2024 11:52:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1507571#M71096</guid>
      <dc:creator>MohamedHassan17</dc:creator>
      <dc:date>2024-07-21T11:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Map during export layout as PDF using python script</title>
      <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1507987#M71103</link>
      <description>&lt;P&gt;Are you saving the map after the updates, symbology, etc. but before the PDF export?&lt;/P&gt;&lt;P&gt;R_&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 15:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1507987#M71103</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2024-07-22T15:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Map during export layout as PDF using python script</title>
      <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1507994#M71104</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe add,&lt;/P&gt;&lt;P&gt;time.sleep(4) ensures that all changes have time to be fully applied before exporting to PDF.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import time

# Define your project and layout
aprx = arcpy.mp.ArcGISProject("CURRENT")
layout = aprx.listLayouts()[0]

# Define your map frame and map
map_frame = layout.listElements("MAPFRAME_ELEMENT")[0]
map_view = map_frame.map
layer = map_view.listLayers()[0]  # Modify as per your layer

# Refresh the map view
map_frame.camera.setExtent(map_frame.camera.getExtent())  # Trigger a refresh by resetting the extent

# Wait for a moment to ensure all changes are applied
time.sleep(4)

# Export to PDF
output_pdf = r"path_to_your_output.pdf"
layout.exportToPDF(output_pdf)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2024 15:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1507994#M71104</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-07-22T15:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Map during export layout as PDF using python script</title>
      <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1508565#M71108</link>
      <description>&lt;P&gt;Yes, I did but not working.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 13:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1508565#M71108</guid>
      <dc:creator>MohamedHassan17</dc:creator>
      <dc:date>2024-07-23T13:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Map during export layout as PDF using python script</title>
      <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1509291#M71110</link>
      <description>&lt;P&gt;Maybe increase the sleep time.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 14:38:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1509291#M71110</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-07-24T14:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Map during export layout as PDF using python script</title>
      <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1511067#M71141</link>
      <description>&lt;P&gt;the issue still occurred.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 18:47:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1511067#M71141</guid>
      <dc:creator>MohamedHassan17</dc:creator>
      <dc:date>2024-07-27T18:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh Map during export layout as PDF using python script</title>
      <link>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1512498#M71156</link>
      <description>&lt;P&gt;Maybe convert labels to annotation using, &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/cartography/convert-labels-to-annotation.htm" target="_self"&gt;arcpy.cartography.ConvertLabelsToAnnotation,&lt;/A&gt; before the export.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 17:45:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/refresh-map-during-export-layout-as-pdf-using/m-p/1512498#M71156</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-07-30T17:45:14Z</dc:date>
    </item>
  </channel>
</rss>

