Copy link to clipboard
Copied
hi!
I want to insert an image into a rectangle made of JavaScript fan tools.
var i = 0;
for (var p = 1; p <= myPages.length - 1; p++) {
for (var n = 1; n <= 1; n++) {
if (i <= myOutGroupPics1.length - 1) {
myPages[p].pahts -> What should I change this place to?
.item("myOutGroup" + n)
.place(File(myOutGroupFolder1 + "/" + myOutGroupPics1[i].name));
i++;
}
}
}
Hi @text_driver
It seems this thread is also related to the one we discussed here, if it is then I suppose you have your answer, and if you say I can merge this thread with the other one.
-Manan
Copy link to clipboard
Copied
hi!
I want to insert an image into a rectangle made of JavaScript fan tools.
var i = 0;
for (var p = 1; p <= myPages.length - 1; p++) {
for (var n = 1; n <= 1; n++) {
if (i <= myOutGroupPics1.length - 1) {
myPages[p].pahts -> What should I change this place to?
.item("myOutGroup" + n)
.place(File(myOutGroupFolder1 + "/" + myOutGroupPics1[i].name));
i++;
}
}
}
Hi @text_driver
It seems this thread is also related to the one we discussed here, if it is then I suppose you have your answer, and if you say I can merge this thread with the other one.
-Manan
Copy link to clipboard
Copied
I am unsure what you are storing in myOutGroupPics1.
Just to place an Image file into an already made rectangle you can do this like this:
var myImagFile = File("~/Desktop/Untitled.png");
var myRectangle = app.documents[0].pages[0].rectangles[0];
myRectangle.place(myImagFile);
myRectangle.fit(FitOptions.CONTENT_TO_FRAME);
Best
Sunil
Copy link to clipboard
Copied
Hi @text_driver
It seems this thread is also related to the one we discussed here, if it is then I suppose you have your answer, and if you say I can merge this thread with the other one.
-Manan