Hello,
I was able to diagnose the issue for my particular problem. I was reusing a project file which over time accumulated numerous layouts which in turn increased the time to export the layout to a PDF. If you continue to run into the issue here is some python code that works:
import arcpy.mp as mp
# Get the current project
aprx = mp.ArcGISProject("CURRENT")
# Get a list of layouts in the project
layouts = aprx.listLayouts()
# Select the first layout in the list (you can modify this as needed)
layout = layouts[0]
# Set the output path and file name for the PDF file
output_path = r"C:\path\to\output\folder"
output_file = "output.pdf"
# Construct the full output file path
output_pdf = output_path + "\\" + output_file
# Export the selected layout to PDF format
layout.exportToPDF(output_pdf)
I hope this helps!
-J