Copy link to clipboard
Copied
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
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).
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 any
...Copy link to clipboard
Copied
Yes, it's possible.
Copy link to clipboard
Copied
Hello Leo -
thanks for your reply.
But how? Could you guide me a bit please?
- Dimitri
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Hi @Fred.L ,
I would suggest a different algorithm:
Export the frame as snippet file ( *.idms ), that would automatically include the whole group if the frame is part of a group or a more complex object like a nested group of objects or pasted inside a graphic frame.
Place the *.idms file in a new document's page and export it from there to JPEG.
In case you do not want the group, just do a duplicate of the frame and export the duplicate to JPEG.
Remove the duplicate after done.
Kind regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hello Fred —
Hello Uwe Laubender —
OK, thanks,
at the end I made work the export as .JPG of selected (or all if none selected) rectangle frame box and/or entire group.
But my colleague ask me to export the expanded "placed image/link" as .PDF (so no more a crop version, but the entire placed image). Place image are actually ALL .AI files (Illsutrator file).
Is there a way to do that?
Since I spent already hours trying to make it work, but can't make it work.
And some artificial intelligences told me that it 's impossible.
But not sure I believe that 😉
1. For a while I was thinking to (re)save the .ai file withe a .PDF extension. But my .ai files are really big (like more than hundreds MB) and it's way to big as .PDF. (but it should work).
2. After that as said, I tried to export the placed image (.ai file) itself. But I'm not good enough in coding or as artificial intelligences are saying "it's impossible", I dunno.
3. Another way, edit/open the placed image (.Ai file) in Illustrator and from there save it as .PDF (will full control of the .PDF parameters). But is this a realist/valid option? Since I hvae to export dozen and dozen large .ai file as .PDF
What's your opinion?
Do you see other options?
Many thanks for any upcoming feedback
- Dimitri
Copy link to clipboard
Copied
But my colleague ask me to export the expanded "placed image/link" as .PDF (so no more a crop version, but the entire placed image).
By @dimitri_cas
If I understand your question correctly, then you need to:
-Get geometric bounds of the placed .ai file itself (that is, parent of link)
-Get geometric bounds of its frame
-Set geometric bounds of the frame to the bounds of the .ai file (that is, uncrop the image)
-Export the uncropped image.
Copy link to clipboard
Copied
Hello leo.r -
Thx for your answer,
to summarize, my colleague came now with a second request which is the following:
"I need also a .PDF (very important) of the full placed image (which is actually and always will be an .ai file)".
To summarize the summarize —> a .PDF of the link/of the placed .ai file (not cropped).
Is this possible?
Thank you.
- Dimitri
Copy link to clipboard
Copied
To summarize the summarize —> a .PDF of the link/of the placed .ai file (not cropped).
By @dimitri_cas
Is this possible?
Yes, my answer above describes the process that should achieve what you need, as far as I understand it.
Copy link to clipboard
Copied
Hey @dimitri_cas
Correct me if I'm wrong,
- you want to get all placed .ai files in the active document in .pdf files
I believe there are many ways to get it done, but some of them may not be what you actually want in the end.
Before proposing something, here are my thoughts and questions :
- What is the dimensions of the pdf file you'd like to get?
By essence, .ai files don't have fixed dimensions. They are vectors, meaning you can resize them without losing any detail. Exporting them one at the time (1 file, 1 export) + combining the exported files could not be the best option
- Are all .ai files placed full size in your document? or some bigger than others. In other words, do you want to keep the current size of the frames containing the .ai files or can them be adjusted full size?
Solutions vary, depending on your needs. You could move all the frames containing the .ai files on a specific layer/ hide the other and export the document in PDF (but that would keep the current dimensions of the file). You could identify the .ai files within the Links panel / create new file / place the all in there with special object style / Export as PDF (possibly changing the dimension of the file).
Copy link to clipboard
Copied
Hi @dimitri_cas ,
if you want to export an object to PDF in InDesign, you will always export the whole InDesign page.
The workaround would be to duplicate the object to a new InDesign page, resize the page to the dimensions of the duplicated object and export the PDF from there.
However there are practical problems with that if, for example, a drop shadow was applied to the object and you want to export to PDF with the dop shadow intact.
Kind regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi @dimitri_cas ,
if you want to export an object to PDF in InDesign, you will always export the whole InDesign page.
By @Laubender
Hi Uwe,
We can also export specific objects to PDF without exporting the entire page (via scripting only, obviously). Unless I misunderstood what you said?
EDIT: Wait, I know what you meant: that the PDF page size will always be the full InDesign page size, even if we export individual objects. Yeah, that's true!
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now