Skip to main content
June 24, 2010
Question

Not able to check if a group item has a over print fill.

  • June 24, 2010
  • 1 reply
  • 867 views

I am abe to check over print fill for path item and raster item. But not able to check if a group item has a over print fill.

This topic has been closed for replies.

1 reply

June 24, 2010

How do you overprint a group? Aren't the individual items inside the group overprinting?

June 24, 2010

Yes you are correct. The individual items inside the group are having over print. But if the objects path item or raster item are directly in the document, I am able to check the over print fill. But when they are part of a group item I am not able to do the same. When I try to do the same for objects inside a group item I get the object as undefined.

Code:

for (iii=0 ; iii<doc.pageItems.length ; iii++) {
 
   switch ( doc.pageItems[iii].typename ) {
    case "PlacedItem":
   
     if ( ! doc.pageItems[iii].embedded ) {
      errors.push(doc.name + " has linked file " + doc.pageItems[iii]);
     }
     if(doc.pageItems[iii].overprint == true) {
      errors.push("-Over print found in the following object : " + doc.pageItems[iii].typename);
     }
    break;
    case "RasterItem":
    if ( ! doc.pageItems[iii].embedded ) {
      errors.push(doc.name + " has linked file " + doc.pageItems[iii]);
     }
    
    if(doc.pageItems[iii].overprint == true ) {
      errors.push("-Over print found in the raster item");
     
    }
    break;
    case "CompoundPathItem" :
    
    break;
    case "GraphItem" :
   
    break;
    case "GroupItem" :
    // when I get a group item over here I need to get into the objects inside the group item and do over print fill check.
    break;
    case "LegacyTextItem" :
     errors.push("-Legacy text found ");
    break;
    case "MeshItem" :
   
    break;
    case "PathItem" :
   
    if(doc.pageItems[iii].overprintFill == true  ) {
      errors.push("-Over print found in the image");
     
    }
    
    break;
    case "PlacedItem" :
    
    break;
    case "PluginItem" :
    
    break;
    case "RasterItem" :
     if(doc.pageItems[iii].overprint == true) {
      errors.push("-Over print found in the following object : " + doc.pageItems[iii].typename);
     }
    break;
    case "SymbolItem" :
   
    break;
    case "TextFrame" :
   
             
     if(doc.pageItems[iii].textRange.length > 0) {
      var itemType = doc.pageItems[iii];
      if ( doc.pageItems[iii].converted == false) {
       errors.push("-Legacy text found ");
      }
      else if(doc.pageItems[iii].textRange.overprintFill == true || doc.pageItems[iii].textRange.overprintStroke == true) {
       errors.push("-Text over print found " + doc.pageItems[iii].contents);
      }
     }      
    break;
   }
  }

When the case is group item,

I used the below piece of code

doc.pageItems[iii].pageItems[0].overprint

This was giving undefined, the object actually is path item inside the group item, but the overprint method doesn't works with this path item object.

June 24, 2010

The way I did it was to create an artset with the objects that I want to change overprinting on. The set could include groups of objects, but the objects in the group also get added to the set, so they get adjusted as well. It seems that with careful artset creation, this may work for you too.

Also, it looks like you're using scripting, which is not what this forum is intended for. My method may not work or even be possible in script.