Skip to main content
Inspiring
September 19, 2025
Answered

How to Export as single .JPG file a rectangle frame including its placed image/link, possible?

  • September 19, 2025
  • 3 replies
  • 1021 views

Hello -

 

I try to make the following via a .jsx script, but not sure it's posible,
especially the "export as single .JPG file the rectangle frame  including its placed image/link"…

Via an dialog box, offer the option to the user to EITHER export ALL included "Design Frame Rectangle/" (and its placed image/link) at once OR to export the current selected design frame only.

 

Anyways, they should be export as single .JPG file (high quality, @300dpi, antialiasing "on").

You will need to create a new folder with the name of the open .indd file in the same location as the open .indd file.

Be careful, sometimes, the design frame rectangle can be part of a group, in that case you will have to export

the whole group as .JPG (white background as default).

BUT for each link, I'll need:

A. One time an export of the "Design Frame Rectangle" with its link (as .JPG). Here the link could be partially hidden/cropped via a mask but it's OK.

B. Another time, if the "Design Frame Rectangle" is part of a group, an export of the whole group (again as .JPG).

C. A third time (still based on the same link), an export of the link itself as .PDF (Low Resolution for now, could be change later). And if a .PDF wasn't possible, just export the links itself as a .JPG

 

Each time, and for each export, use the name of the link itself and if needed §to not overwrite an existing name) adds something like "_2" or "_3" and so on…

One typical .indd file would look like the attached file.

Thanks for any feedback/input.
Enjoy your day
 
 
 
- Dimitri

 

Correct answer dimitri_cas

Hello Everybody  🙂

 
 
So… .JPG export "process" works super fine.
 
Regarding the .PDF export,

•  My colleague want an .PDF of  the full placed .ai file (not cropped as it was the case with the .JPG "process").
•  .PDF needs to be the "mirror" of the .AI file(ie. HV@100%, …)

•  Someone said "By essence, .ai files don't have fixed dimensions."  —>   Absolutely.

•  Someone asked "Are all .ai files placed full size in your document?"  —>  YES, placed HV@100% always.

•  Currently my colleague don't know anything about how she wants the .PDF (eg. quality that she wants, all layers visibles or not, …)

 

So, at the end, what I did (and it works):
1. Get the path of the placed .ai file in the selected Rectangle Frame box and/or (sub)group. One or many selected and even if nothing is selected (in tha case, all the placed .ai files wiil be exported), …

2. Create a folder on the server with the name XXX_PDF_EXPORTED" (or similar).
3. Make a copy of the .ai file into that folder and change its extension to .pdf (that way my colleague can even show/hidden the layers she wants, …)


Later I'll do a small app to reduce size (and more) of the all the .PDFs in that folder.

 

For now, I guess it will do the job.

 

Tahank again, for all your input.

Enjoy your day.

 

 

 

- Dimitri

 

 

3 replies

dimitri_casAuthorCorrect answer
Inspiring
September 25, 2025

Hello Everybody  🙂

 
 
So… .JPG export "process" works super fine.
 
Regarding the .PDF export,

•  My colleague want an .PDF of  the full placed .ai file (not cropped as it was the case with the .JPG "process").
•  .PDF needs to be the "mirror" of the .AI file(ie. HV@100%, …)

•  Someone said "By essence, .ai files don't have fixed dimensions."  —>   Absolutely.

•  Someone asked "Are all .ai files placed full size in your document?"  —>  YES, placed HV@100% always.

•  Currently my colleague don't know anything about how she wants the .PDF (eg. quality that she wants, all layers visibles or not, …)

 

So, at the end, what I did (and it works):
1. Get the path of the placed .ai file in the selected Rectangle Frame box and/or (sub)group. One or many selected and even if nothing is selected (in tha case, all the placed .ai files wiil be exported), …

2. Create a folder on the server with the name XXX_PDF_EXPORTED" (or similar).
3. Make a copy of the .ai file into that folder and change its extension to .pdf (that way my colleague can even show/hidden the layers she wants, …)


Later I'll do a small app to reduce size (and more) of the all the .PDFs in that folder.

 

For now, I guess it will do the job.

 

Tahank again, for all your input.

Enjoy your day.

 

 

 

- Dimitri

 

 

BobLevine
Community Expert
Community Expert
September 25, 2025

A properly saved AI file already has the PDF built into it. That's the part that InDesign reads.

 

In fact, you can open that AI file from Acrobat directly with no further work.

Inspiring
September 25, 2025

Hello Bob -

 

I know, that's why (partially) I took that option.  😉
Simple, yet efficient.

And as said, after my colleague know what she wants,
I'll just process all the (very large) .PDFs with a little drag'n drop application that I'm going to make.
 

 
- Dimitri

 

Fred.L
Inspiring
September 19, 2025

Hey,

Have a look there !
https://creativepro.com/new-indesign-script-to-export-jpegs-at-a-precise-size
Keith Gilbert may have written something that would exactly do the job for you, or at least, most of it

 

 

 

Inspiring
September 20, 2025

Hey Fred -

 

Thanks for your reply.

If I'm understand correctly what the script does, it's not really what I'm looking for.

Exporting a wholme page as .PNG/.PNG is easy.

Here, in my case I want to export not the whole page, but rather every single "design frame box" and it's placed image (or link) as on single file.

In other words, one design frame box = 1 exported .JPG/.PNG.

 

Still possible?

Thanks.

 

 

 

- Dimitri

 

Fred.L
Inspiring
September 21, 2025

Hey,

If I'm not mistaken, you said :
OR to export the current selected design frame only.

The script Export to JPG – selection.jsx does exactly this.

 

As per,

export ALL included "Design Frame Rectangle/"

The questions that I would have in mind are :

- Is there any choice to make upon the exports?

- Do you want to export everything? in the document? just the frame/ groups containing graphics?

- Are there groups or single textframes? graphic frames? How do you identify them?

 

Doing it manually would be more time consuming, but you won't have to script the sorting part. Just click + run the script would export the block, being a single or a group of frames.

I you want to export automatically everything, you would have to either :

- identify the frames, verifying if they are part of a group, get to the group parent / select it / export it
- find /name the groups (script label for instance) /export the groups using the name (1 same name for all) + export all single frames

 

 

Does that help?

leo.r
Community Expert
Community Expert
September 19, 2025

Yes, it's possible.

Inspiring
September 20, 2025

Hello Leo -

 

thanks for your reply.

But how? Could you guide me a bit please?

 

- Dimitri

 

leo.r
Community Expert
Community Expert
September 21, 2025

InDesign JavaScript API is here:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/

 

As far as I understand you're an experienced JS developer anyway so just find the desired functions there. (My JS experience is limited).