Select to view content in your preferred language

Help - Large file sizes exporting to PDF using ArcPy

882
4
11-10-2010 02:04 PM
AaronPaul
Deactivated User
Hi All-
I'm using arcpy.mapping to export to pdf but the file sizes are enormous.
My export looks like this:

arcpy.mapping.ExportToPDF(mxd, Temp_Data + os.sep + "Aerial.pdf","PAGE_LAYOUT",640,480,300,"NORMAL","RGB","True","DEFLATE","RASTERIZE_BITMAP","FALSE","TRUE","NONE","FALSE")

The maps are for printing only, so can lose any unnecessary functions.
I'd like to reduce file sizes but retain print quality.

If we can't reduce could we export to different format and convert back to pdf?
End goal is to append multiple pages so they can be printed and/or viewed digitally.

Thank you
0 Kudos
4 Replies
JeffBarrette
Esri Regular Contributor
How large is your result? Have you compared the export size from arcpy.mapping to the same export via the ArcMap user interface?  They should be the same.  Please let me know if you see differences.  If arcpy.mapping is producing a result that is different from the UI export, they we must know that.

FYI - With SP1 we've introduced additional compression options/settings.
0 Kudos
AaronPaul
Deactivated User
SP1 for 10 solved mostly the problem 😮

Adding the option for Adaptive was the solution.
I found it the same day I posted this thread which happened to be the release dat of SP1.

Jeff, you mentioned additional compression settings. Are there other settings aside from Adaptive?

Also, do you expect any innovations toward fully optimizing .pdf's as you can through Adobe?
More specifically, Adobe has an option to save as "Adobe PDF Files, Optimized".

I still have to save pack, then open and save as an optimized format to fully reduce file size.

My file sizes are @ 8,000 kb which is the same as if I export from mxd or arcpy.

If arcpy could dig into Adobe the optimized file type, that would complete my automation process and make it emailable all through scripting.

Thank you in advance, Aaron
0 Kudos
JeffBarrette
Esri Regular Contributor
Aaron,

I'm glad that helped out.  At SP1, with ExportToPDF and ExportToEPS, we added Adaptive and JPEG compressions.  We also added the {jpeg_compression_quality} parameter.

I am not aware of future additions concerning Exporting to PDF.  My focus has been on making sure that arcpy.mapping provides the same results as the ArcMap UI.  I will look into this for you.

Jeff
0 Kudos
JeffBarrette
Esri Regular Contributor
Also - any suggestions you have for software enhancements are always welcome and encouraged to be put on the http://ideas.arcgis.com website.

Thanks again,
Jeff
0 Kudos