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

create a rectangle with a image inside

New Here ,
Mar 23, 2016 Mar 23, 2016

Hi all

Question of great starter... how create a rectangle with a image inside.

My project :

- Create a dialogue box where put the name of the picture.

- create the link between the picture to the active document (picture is in "Links" folder)

- do a rectangle in my document with a picture inside.

All the think is ok except the last stage (on a start, i was mind "that is the most easier"... but no).

Thank a lot, and sorry for my english.

TOPICS
Scripting
1.2K
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

correct answers 1 Correct answer

Advisor , Mar 24, 2016 Mar 24, 2016

to add a rectangle:

var rect=doc.rectangles.add();

to place a picture inside it:

rect.place(FIle(image.path));

Translate
Guide ,
Mar 23, 2016 Mar 23, 2016

Hi,

Adobe giving some free scripts you can use that. Name of script is ImageCatalog.jsx.

Thanks,

Karthi

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
Advisor ,
Mar 24, 2016 Mar 24, 2016

to add a rectangle:

var rect=doc.rectangles.add();

to place a picture inside it:

rect.place(FIle(image.path));

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
New Here ,
Mar 24, 2016 Mar 24, 2016

Simple and powerful, thank a lot.

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
New Here ,
Nov 07, 2022 Nov 07, 2022

Hi @Vamitul  

adding to same issue i have if we want to changes the bounds of the rectangle after place image

1-add a rectangle

2-place image

3-change the rectangle bounds (which result in cropping of image)

can we do this with script ?

Thanks in Advance!!

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
Community Expert ,
Nov 07, 2022 Nov 07, 2022
LATEST

You can set the geometricBounds of the rectangle. It is an array of numbers in the format [y1, x1, y2, x2]. You might want to also look at setting the measurement units before making the change, if you want to set the values in a unit other than points

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#MeasurementUnits.html#d1e78257

-Manan

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