exportToPDF hangs in arcgis pro 2.8 running from toolbox .tbx

2826
14
Jump to solution
05-28-2021 08:45 AM
Labels (1)
IanAlexander
New Contributor II

I have an toolbox .tbx running a python / arcpy script that exports the layout to PDF and EPS .  This toolbox worked in 2.7 , but now hangs in 2.8 .  The lines it hangs on is:

the_layout.exportToPDF("C:\\temp\\test.pdf")

The same issue also occurs on:

the_layout.exportToPDF("C:\\temp\\now.pdf")

No exceptions are caught, the application just spins and does not return from the method call. Pressing cancel on the running toolbox does not stop this.  Only killing the application in the task manager exits this. Oddly, the PDF file is created.

In the python window, the following code works as expected and does not hang:

aprx = arcpy.mp.ArcGISProject("current")
the_layout = aprx.listLayouts("letter_portrait")[0]
the_layout.exportToPDF("C:\\temp\\now.pdf")

14 Replies
Marshal
New Contributor III

Just wanted to chime in here since I am having a similar issue since updating to 2.8.  All of my scripted maps are hanging on exportToPDF.  This is occurring both from python directly, and from Pro toolboxes.  The time.sleep workaround did not work for me unfortunately.  Thank you for the potential solution though, and glad it worked for you.

0 Kudos
JeffBarrette
Esri Regular Contributor

This is going to be addressed in the 2.8.2 patch.

 

Jeff - arcpy.mp and Layout teams

ohughes2
New Contributor

Hi Jeff, I'm having a problem with the exportToPDF() hanging as well.  I have an aprx with multiple layouts. I'm converting a script that previously worked with arcpy.mapping to arcpy.mp and I'm unable to get the script to complete. It seems to make it all the way to exportToPDF and then hangs, it doesn't throw an error to catch either.

0 Kudos
Marshal
New Contributor III

That is great news.  Thank you for the update, Jeff!

I realize this may be asking too much, but do you have any sort of time frame when 2.8.2 might drop?  More than a month?  Trying to evaluate if it is worth reinstalling 2.7 to get these processes working.

No worries if you cannot provide insight.  Just thought it couldn't hurt to ask.

Thanks again for the help!

0 Kudos
IanAlexander
New Contributor II

This issue seems to be resolved with the 2.8.2 release .  The layout export is working as expected.