khadler

DataDrivenPages.PrintPages, How do I create .ps files for each page?

Discussion created by khadler on Jan 13, 2012
Latest reply on Jan 17, 2012 by jbarrette-esristaff
I need to print my Data Driven Pages to a postscript file each night as a scheduled task.  I have tried the following python script.  It does not generate an error.  However the postscript files are not created.

import arcpy, os
sdeFile = r"F:\GIS\GISDATA\SoftwareESRI\UtilPrint.sde"
if os.path.exists(sdeFile):
    os.remove(sdeFile)
arcpy.CreateArcSDEConnectionFile_management(r'F:\GIS\GISDATA\SoftwareESRI','UtilPrint', 'vorsql', '5151', 'vorgis','DATABASE_AUTH', 'USERNAME', 'PASSWORD', 'SAVE_USERNAME', 'SDE.DEFAULT', 'SAVE_VERSION')
from arcpy import mapping
mxd = arcpy.mapping.MapDocument(r"F:\GIS\GISDATA\UFiber\FiberTruckMaps11by17.mxd")
mxd.dataDrivenPages.printPages("Fake5550PS", "ALL", r"F:\MAPS\UtilityPDFmaps\CopyofRantoulUtilities_files\Fiber\Fiber.ps")
del mxd
os.remove(sdeFile)

Outcomes