Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a small python script which exports a set of data driven pages to PDF. This works fine, including appending each page to an 'all' pdf.

My issue is that it creates rasters of each layer in the map.

I can use something like CutePDF to print to a vector map, and that works great. Much smaller filesizes, but this is not easily done in a batch process. It requires you to choose the file name of each page manually.

My question is this: Can you make Arcpy's ecport to pdf method actually use vector format for the content of the map. If not, is there a way to automate the printing to file, using cutePDF or something else?

Cheers,

Alex

share|improve this question
    
Let me see if I read you correctly: when using arcpy, you get raster, but with cutepdf you actually get the desired result, but of course not in batch? –  ako Jul 29 '11 at 6:10

2 Answers 2

This may or may not have anything to do with arcpy. In the ArcMap 9 series, when exporting maps which included raster layers or even bitmap patterns, vectors would be rasterized as well. If you are using some of the online map resources that may still be the case. I don't have an installation here to check it, but see if turning off any raster layers makes any difference.

share|improve this answer
2  
This is exactly it. Transparency triggers rasterization as well. –  Jason Scheirer Jul 29 '11 at 5:48
    
To find all the layers that rasterize, loop through the layers in the data frame and check the isRasterizingLayer property on the Layer object for each layer. –  Craig Williams Aug 1 '11 at 4:44
    
Aha. I used this script: help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… –  alexgleith Aug 4 '11 at 2:51

I used the following python code to identify rasterising layers. Removing these (had to let go of some transparency) reduced the file size by 50%.

import arcpy

def DetectRasterization():
  mxd = arcpy.mapping.MapDocument("CURRENT")
  df_list = arcpy.mapping.ListDataFrames(mxd)
  foundRasterization = False
  noneFoundMsg = "No rasterizing layers were detected."
  for df in df_list:
    lyr_list = arcpy.mapping.ListLayers(mxd, data_frame=df)
    for lyr in lyr_list:
      if lyr.isRasterizingLayer or lyr.supports("BRIGHTNESS"):
        foundRasterization = True
        if lyr.isGroupLayer and lyr.transparency > 0:
          print "In data frame '" + df.name + "', the group layer '" + \
                   lyr.longName + "' is a rasterizing layer:\r",
          print "\tVisibility is " + str(lyr.visible) + ".\n" + \
                "\tTransparency is " + str(lyr.transparency) + " percent.\n"
        elif not lyr.isGroupLayer:
          print "In data frame '" + df.name + "', the layer '" + \
                   lyr.longName + "' is a rasterizing layer:\r",
          if lyr.transparency > 0:
            print "\tVisibility is " + str(lyr.visible) + ".\n" + \
                  "\tTransparency is " + str(lyr.transparency) + " percent.\n"
          else:
            print "\tVisibility is " + str(lyr.visible) + ".\n" + \
                  "\tTransparency is 0 percent, but the layer may be a\n" + \
                  "\traster layer or contain rasterizing symbology such\n" + \
                  "\tas bitmap picture symbols.\n"
      del lyr
    del lyr_list
    del df
  if not foundRasterization:
    print noneFoundMsg
  del df_list
  del mxd

DetectRasterization()
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.