Print/Export Data Driven Pages to plot files

543
6
03-15-2011 04:39 AM
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I'm looking for a way to export out each Data Driven Page of a map document to a Plot file (.PRN).  I don't want to send them all to the printer at once.  I'd like to be able to write them out to plot files (.PRN) and send them as needed.  I imagine this could be done via Python but I'm not to versed in it. 

Any help would be appreciated.
0 Kudos
6 Replies
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
OK, I've muddled my way through Python and have written some code to export out each page as a PRN.  New Problem:  the files are HUGE!  If I write out just one page using file-->print (check box print to file) I get a 65MB file.  Using arcpy (code below) my PRN is over 200MB.

I can't see a way to set printer parameters.  am I missing something?

FYI - there is an ortho overlaid.

import arcpy
MxdPath = arcpy.GetParameterAsText(0)
OutPath = arcpy.GetParameterAsText(1)
PrinterPath = arcpy.GetParameterAsText(2)

mxd = arcpy.mapping.MapDocument(MxdPath)
arcpy.SetProgressor("default","Exporting Data Driven Page to Plotfile...")
arcpy.SetProgressor("step","",0,mxd.dataDrivenPages.pageCount,1)
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
    mxd.dataDrivenPages.currentPageID = pageNum
    pageName = mxd.dataDrivenPages.pageRow.SORTMAPNUM
    arcpy.SetProgressorLabel("Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount)))
    arcpy.SetProgressorPosition(mxd.dataDrivenPages.currentPageID)
    arcpy.AddMessage("Writing File: " + OutPath + "\\"  + str(pageName) + ".prn")
    arcpy.mapping.PrintMap(mxd,PrinterPath,"PAGE_LAYOUT",OutPath + "\\"  + str(pageName) + ".prn")

del mxd



0 Kudos
JeffBarrette
Esri Regular Contributor
We reproduced this bug an will hopefully be able to address it in the next service pack.

If you want to check its status, it is: NIM067146

Thanks!
Jeff
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I contacted Tech Support after I posted this and they logged this as a bug.  They logged it as: NIM066026.  Perhaps these two NIM's should be combined.
0 Kudos
JeffBarrette
Esri Regular Contributor
We addressed this issue.  Arcpy.mapping was always using BEST for image quality therefore the image sizes were always larger.  We've exposed a new {image_quality} parameter to the PrintMap function.

Jeff
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
I imagine this is a post-SP2 fix?
0 Kudos
JeffBarrette
Esri Regular Contributor
Yes.  The fix was just verified.  It is marked to go into SP3.

Jeff
0 Kudos