0

I'm trying to write an script (javascript) to export an group to an image. This works but the group has pageitems that extend beyond the page size. The problem is that when exporting the group the clipping is not there anymore, so the exported image is bigger then the page.

I searched a lot, but could not find anything on clipping a group to the page on export.

I hope someone can help me out.

ekad
  • 14,436
  • 26
  • 44
  • 46
Richy
  • 71
  • 2

1 Answers1

0

You might be exporting a doc page instead of the group itself which may have the consequence of cropping the image to the page bounds.

Given that would be your issue, the solution would be to call exportFile on the object itself:

var main = function() {
 var doc, gp;
 
 if (!app.documents.length) return;
 
 doc = app.activeDocument;
 
 gp = doc.groups[0];
 
 gp.isValid && gp.exportFile ( ExportFormat.JPG, File ( Folder.desktop+"/group.jpg" ) );
}


main();

HTH

Loic
  • 2,173
  • 10
  • 13