import arcpy, os # Create an output directory variable # outDir = r"C:\Working_Directory\Combined" # Create a new, empty pdf document in the specified output directory # finalpdf_filename = outDir + r"\FinalStorm.pdf" if os.path.exists(finalpdf_filename): os.remove(finalpdf_filename) finalPdf = arcpy.mapping.PDFDocumentCreate(finalpdf_filename) # Add the title page to the pdf # # finalPdf.appendPages(r"G:\CamarilloGIS\Projects\Atlases\Storm_Drain\2007\CoverSheet.pdf") # Add the index map to the pdf # # finalPdf.appendPages(r"G:\CamarilloGIS\Projects\Atlases\Storm_Drain\2007\GridIndex.pdf") # Create Facing Pages for the map book # Create pages for left-hand side of the book # mxdPathLeft = r"G:\CamarilloGIS\Projects\PublicWorks\STORMWATER\Updates\Even11x17_Aerial.mxd" tempMapLeft = arcpy.mapping.MapDocument(mxdPathLeft) tempDDPLeft = tempMapLeft.dataDrivenPages # Loop creates individual pdf's for odd numbered pages # #for pgNumLeft in range(1, tempDDPLeft.pageCount + 1,): # temp_filename = r"C:\Working_Directory\L_" + \ # str(pgNumLeft) + ".pdf" # if os.path.exists(temp_filename): # os.remove(temp_filename) # tempDDPLeft.exportToPDF(temp_filename, "RANGE", pgNumLeft) # # Create pages for right-hand side of the book # mxdPathRight = r"G:\CamarilloGIS\Projects\PublicWorks\STORMWATER\Updates\Odd11x17_Aerial.mxd" tempMapRight = arcpy.mapping.MapDocument(mxdPathRight) tempDDPRight = tempMapRight.dataDrivenPages # Loop creates individual pdf's for even numbered pages # #for pgNumRight in range(2, tempDDPRight.pageCount + 1,): # temp_filename = r"C:\Working_Directory\R_" + \ # str(pgNumRight) + ".pdf" # if os.path.exists(temp_filename): # os.remove(temp_filename) # tempDDPRight.exportToPDF(temp_filename, "RANGE", pgNumRight) # Append right and left-hand pages together in proper order i = 1 #set i equal to 1 to start with the first PDFs for pgNum in range(1, tempDDPLeft.pageCount + 1): print "Page", pgNum, "of", tempDDPLeft.pageCount tempPDF = r"C:\Working_Directory\combined" + os.sep + str(pgNum) + ".pdf" finalPdf.appendPages(r"C:\Working_Directory\L_" + str(i) + ".pdf") #appends the first PDF from the odds finalPdf.appendPages(r"C:\Working_Directory\R_" + str(i) + ".pdf") #appends the first PDF from the evens i = i + 1 #adds 1 to i so that it will append PDFs number 2 next, then 3, 4, and so on through 48finalPdf.appendPages(tempPDF) # Update the properties of the final pdf # finalPdf.updateDocProperties(pdf_open_view="USE_THUMBS", pdf_layout="SINGLE_PAGE") # Save your result # finalPdf.saveAndClose() # Delete variables # del finalPdf, mxdPathLeft, mxdPathRight, tempDDPLeft, tempDDPRight, tempMapLeft, tempMapRight, tempPDF
Then you would think it would be correct, unless it changed between 10.1 and 10.2. Hard to say without doing a lot more digging....which, since you got it working, just worth noting I guess.