Export to PDF Data Driven Pages

Discussion created by mikedeseo on Feb 6, 2014
Latest reply on Jan 24, 2018 by mastertommy25
Hi, I'm new to Python and trying to write a script that will do the following:

1.  Loop through all mxd's in a folder and edit a Text Element named "SubTitle"
2.  Save the mxd
3.  Export each mxd to pdf

The problem is there are some mxd's with Data Driven Pages enabled, so I can't get the script to export ALL pages of a multi-page map.  I wrote an "if-else" so that I can distinguish the multi-page maps from the single page maps.  Everything else works fine except for the ddp map. 

The error msg I get:
ddp.ExportToPDF(mxd, basename, "ALL")
AttributeError: 'DataDrivenPages' object has no attribute 'ExportToPDF'

See attached screenshot of the code.