<?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: exportToPDF missing elements in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/exporttopdf-missing-elements/m-p/1073328#M61512</link>
    <description>&lt;P&gt;I've not come across this, but it would be helpful if we could see some of the code being run.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jun 2021 17:23:01 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-06-28T17:23:01Z</dc:date>
    <item>
      <title>exportToPDF missing elements</title>
      <link>https://community.esri.com/t5/python-questions/exporttopdf-missing-elements/m-p/1073326#M61511</link>
      <description>&lt;P&gt;I wrote a script that exports a title page and a map series. When I run the script manually in PyCharm, the title page exports correctly.&lt;/P&gt;&lt;P&gt;When I set up the script to run in windows task scheduler, the title page exports without the map frame (see image below)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Title Page.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17195iBB1FBE24184868EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Title Page.png" alt="Title Page.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone come across this and is there a way to fix it?&lt;/P&gt;&lt;P&gt;Here's the code that exports the title page and map series.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;proProject = "\\\\Scripts\\Python\\MapBook\\MapBook.aprx"
PDFDir = "\\\\Scripts\\Python\\MapBook\\Output"
p = arcpy.mp.ArcGISProject(proProject)

    try:
        # Export new title page to pdf
        TitleFile = PDFDir + "\\TitlePage.pdf"
        tLayout = p.listLayouts("TitlePage")[0]
        tLayout.exportToPDF(TitleFile)
        print("Exported new title page " + "\n" + arcpy.GetMessages())
        mylog.write("Exported new title page" +"\n")
    except:
        message = arcpy.GetMessages()
        print(message)
        mylog.write("Error exporting new title page" + message + "\n")
        arcpy.AddMessage(message)
        mylog.write("Processing Aborted...." + "\n")
        sys.exit("Processing Aborted..")

    try:
        # Export new map book pages to pdf
        MBfile = PDFDir + "\\MapPages.pdf"
        mbLayout = p.listLayouts("MapPages")[0]
        mapSeries = mbLayout.mapSeries
        if mapSeries.enabled:
            mapSeries = mbLayout.mapSeries
            mapSeries.refresh()
            mapSeries.exportToPDF(MBfile)
        print("Exported new map pages" + "\n" + arcpy.GetMessages())
        mylog.write("Exported new new map pages" +"\n")
    except:
        message = arcpy.GetMessages()
        print(message)
        mylog.write("Error exporting new map pages" + message + "\n")
        arcpy.AddMessage(message)
        mylog.write("Processing Aborted...." + "\n")
        sys.exit("Processing Aborted..")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 17:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporttopdf-missing-elements/m-p/1073326#M61511</guid>
      <dc:creator>AliciaShyu</dc:creator>
      <dc:date>2021-06-28T17:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: exportToPDF missing elements</title>
      <link>https://community.esri.com/t5/python-questions/exporttopdf-missing-elements/m-p/1073328#M61512</link>
      <description>&lt;P&gt;I've not come across this, but it would be helpful if we could see some of the code being run.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 17:23:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporttopdf-missing-elements/m-p/1073328#M61512</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-06-28T17:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: exportToPDF missing elements</title>
      <link>https://community.esri.com/t5/python-questions/exporttopdf-missing-elements/m-p/1073441#M61514</link>
      <description>&lt;P&gt;The issue was that the grid was in a database outside of the Pro project. Once the grid was moved to Pro project, the script ran correctly in task scheduler.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 20:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/exporttopdf-missing-elements/m-p/1073441#M61514</guid>
      <dc:creator>AliciaShyu</dc:creator>
      <dc:date>2021-06-28T20:33:38Z</dc:date>
    </item>
  </channel>
</rss>

