We did have a bug for issues with exporting to PDF when running it in the Python Window:
Was wondering if the print statement was just your "test" method. However, was wondering if there was some "trick" that I wasn't aware of.Thanks for the input.Curious as to why my changes don't show until I do a save. Might have to play around with that some more.Are you running in ArcMap 10.1 sp1?R_
Well, without enough information, I was assuming that they are running this script outside of ArcMap, and not within the python window.Not sure in the python window, as I do all my python stand alone. When using arcpy.mapping in standalone, I absolutly have to do a mxd.save() before I export to pdf, or the export looks exactly like the one the last time I did a save regardless of the chages arcpy.mapping just made.also, you say you put a print statement after the refresh in yours, curious what adding a print statement after the refresh does? Print what, and how is it changing the output to pdf?R_
That really shouldn't be necessary. I'd try just adding a print statement after your refresh active view. That is all I have and it works fine.
import arcpy, time df = arcpy.mapping.ListDataFrames(mxd)[0] df.extent = extent arcpy.RefreshActiveView() time.sleep(30) arcpy.mapping.ExportToPDF(mxd,os.path.join(Report_Path,str(oid).upper()))
Have you tried to save the mxd before the export so that the changes you made take effect?R_
Hello all , I am creating a map for each feature in a feature class . I export the map to pdf using python . When i open the map ,I see there are bits and pieces of line features . I suspect I am refreshing my activeview just before exporting the pdf . Before refresh process completes , export to pdf executes and gives me this problem . I am using ArcGIS 10 . Can anyone please help me df = arcpy.mapping.ListDataFrames(mxd)[0] df.extent = extent arcpy.RefreshActiveView() mxd.save() arcpy.mapping.ExportToPDF(mxd,os.path.join(Report_Path,str(oid).upper()))
df = arcpy.mapping.ListDataFrames(mxd)[0] df.extent = extent arcpy.RefreshActiveView() mxd.save() arcpy.mapping.ExportToPDF(mxd,os.path.join(Report_Path,str(oid).upper()))
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.