POST
|
I inserted the print code you recommended and another error comes up.. What goes wrong at Line 11 ? Parsing error SyntaxError: EOL while scanning string literal (line 11) Here's the code import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") pageNameField = "Label" for pageNum in range(1, 5): mxd.dataDrivenPages.currentPageID = pageNum pageName = mxd.dataDrivenPages.pageRow.getValue(pageNameField) pageName = pageName.replace("/", "_") pageName = pageName.replace(" ", "") print("page count {}".format(mxd.dataDrivenPages.pageCount)) mxd.dataDrivenPages.refresh() arcpy.mapping.ExportToPDF(mxd, r"D:\TEMP\" + str(pageName) + ".pdf") del mxd
... View more
10-14-2018
08:15 PM
|
0
|
1
|
368
|
POST
|
Hi Dan I am new in python, so I am copying and combined the sample or code posted to try to get a workaround. Thank you for your suggestion. I tried range (1,5), the small test shows it only process the last page. I wonder if the problem comes from pageName because the code works all right when the second last script ExportToPdf is pageNum.
... View more
10-12-2018
10:10 PM
|
0
|
1
|
368
|
POST
|
Hi, I have the script below. I am trying to export 400 pdfs with the fieldname "Label" but it only export the last page of pdf. What goes wrong ? import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") pageNameField = "Label" for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1): mxd.dataDrivenPages.currentPageID = pageNum pageName = mxd.dataDrivenPages.pageRow.getValue(pageNameField) pageName = pageName.replace("/", "_") pageName = pageName.replace(" ", "") print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount)) mxd.dataDrivenPages.refresh() arcpy.mapping.ExportToPDF(mxd, r"C:\TEST\181013_test" + str(pageName) + ".pdf") del mxd
... View more
10-12-2018
08:43 PM
|
0
|
5
|
521
|
POST
|
Problem is solved by change the language setting: Go to Region and language, administrative, change language for non-Unicode programs to Chinese.
... View more
05-22-2017
02:19 AM
|
0
|
0
|
314
|
POST
|
Hi, I created an empty v9.3 gdb and import scheme from a xml of a V10.0 gdb. The import is success at the first glance. It included feature class, domain and relationship class. But when I close and reopen ArcGIS10 and check v9.3 gdb, domain tables disappear while feature class and relationship remains. Domain table contain Chinese character. I wonder if it is the reason because I can read chinese in v10.gdb, but fail in v9.3.gdb Any thoughts would help. Thank you very much.
... View more
04-25-2017
09:00 PM
|
0
|
0
|
314
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|