我需要將在下面的腳本中創建的文本框移到頁面區域外的出血區域。如果任何人都可以幫助我調整下面的腳本,那就太好了。我一直試圖確定如何使用頁面高度和寬度進行X,Y調整,一旦確定。將文本框外頁移動出血
請參閱下面的代碼。任何和所有的幫助將不勝感激,並提前感謝你。
myDocument = app.activeDocument;
//The bleed and slug properties belong to the documentPreferences object.
with (myDocument.documentPreferences) {
//Bleed
documentBleedBottomOffset = "2in";
documentBleedTopOffset = "2in";
documentBleedInsideOrLeftOffset = "2in";
documentBleedOutsideOrRightOffset = "2in";
//Slug
slugBottomOffset = "0p";
slugTopOffset = "0p";
slugInsideOrLeftOffset = "0p";
slugRightOrOutsideOffset = "0p";
}
var myDocument = app.documents.item(0);
var myPage = myDocument.pages.item(0);
var myTextFrame = myPage.textFrames.add();
//Set the bounds of the text frame [x1, y1, x2, y2]
//The x1, y1 refers to the upper left coordinate position; the x2, y2 refers to the lower right coordinate
//x2 = Height and y2 = Width
myTextFrame.geometricBounds = [0, 0, .52, 5.5];
//Enter text in the text frame.
//("\r" is a return character.+
myTextFrame.contents = "FName Name//12345-6789//\r WxL//\r XXX-YYYYY//W x L-LtrRD//P_";
myTextFrame.parentStory.insertionPoints.item(-1).contents = SpecialCharacters.autoPageNumber;
//Note that you could also use a properties record to
//create the frame and set its bounds and contents in one line:
//var myTextFrame = myDocument.pages.item(0).textFrames.add({geometricBounds:[72, 72, 288, 288], contents:"This is some example text."});
//Absolute move: based on [X , Y] its important to keep in mind that all units are based on your document units
myTextFrame.move([1, 5.5]);
在上述操作中,它將框放置在文檔的右下角。我想將該框放置在X = -1.5161 X =(這將在文檔頁面下方爲.72)。請記住,文檔高度可能會改變,所以我需要這個可以變化) –