Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get bad results from ".cropbox"

New Here ,
Mar 30, 2008 Mar 30, 2008
Hello,

I have a script which creates crop marks at the corners of the new doc:

var myDoc = app.activeDocument;
var selectedObject = myDoc.selection[0];
var objectW = selectedObject.width;
var objectH = selectedObject.height;
myDoc.cropBox = [ 0, 0, objectW, objectH,];

The script runs with no syntax hiccups, but the result is odd. The crop marks look inverted, and when I export an image where any artwork falls outside the paste-board ( not sure if this is the correct term but basically the 'paper area') , that art is included in the export, which is not the normal behavior of a 'Object:Crop Marks:Make" command. I have tried a myriad of digits in those 4 slots of the .cropBox command and not gotten the results I want. What have I missed?

-R

( As a side note: I am a little confused at how Illustrator calculates the placement of objects. x: 0 and y : 0 seems to be the lower left corner of the current paste-board. By choosing an object and moving it to 0, 0 it actually falls off the paste-board. This is unlike what I am used to with Flash which uses the upper left corner for 0,0 solidly placing the art where it would be seen. If anyone knows of a document that explains how to think about the coordinate space in Illustrator, that could help me.)
TOPICS
Scripting
422
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Mar 31, 2008 Mar 31, 2008
LATEST
> If anyone knows of a document that explains how to think about the coordinate space in Illustrator, that could help me.

Vector artwork, despite the eye-candy, is really a process of plotting points on a 2D Cartesian coordinate grid. Illustrator abides by the normal convention for a cartesian coordinate system: Positive values move upward and rightward. Negative values move downward and leftward.(Remember high shool algebra, geometry, trig?) Same goes for most drawing programs, CAD & 3D.

Look up any explanation of Bezier or spline curves and you'll see that the explanations also conform to the Cartesian norm.

Web-centric and page-layout programs tend toward the top-downward approach because their focus is on text, which flows from top to bottom. Raster imaging programs paint a grid of rows and columns called "pixels", so they follow the top-down convention like a spreadsheet. Although Flash is more drawing than text, it "follows along" because it is primarily web-centric.

JET
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines