Select to view content in your preferred language

Add A Title to a PDF using python.

1386
4
06-11-2012 11:56 AM
WilliamIde
Emerging Contributor
I am exporting a map using arcpy.mapping.Export to PDF.  I am panning and zooming to points that have meaning to the user.  I would like to figure out how to add a Title to the map I am exporting.

I have the string of text I what to add.  I trying using the data frame dn.name = "TEXT".  But the just update the ledgend in arcmap.  It seems to me that there should be a way.  I just don't know it.

Thanks
Tags (2)
0 Kudos
4 Replies
MathewCoyle
Honored Contributor
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "element_title"):
    if elm.name == "element_title":
        elm.text = ("Some text")
0 Kudos
WilliamIde
Emerging Contributor
Thanks Mathew,

That didn't work.  Should I have set data driven page to on?  Also,  I put a debug statement in the the for loop and it never goes in there.  Is "TEXT_ELEMENT" really what I'm looking for?

Thanks
0 Kudos
MathewCoyle
Honored Contributor
You need to create a text element that you want as your title, and you need to name it whatever you want to reference in the "element_title" parameter.

You can read the help doc to get all the information you need.
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s30000003w000000
0 Kudos
WilliamIde
Emerging Contributor
That got it thanks so much!
0 Kudos