Skip to main content
Known Participant
August 18, 2012
Question

Exporting graphics/images at full-resolution?

  • August 18, 2012
  • 4 replies
  • 1659 views

Good morning.

So, I've got a series of indesign documents, all of which contain various different types of placed graphics; eps, png, jpg, ai, psd, and the like.

I know that I can export these graphics from Indesign server, via script, by iterating allGraphics, or, splineItems, just to name a few.

What I noticed, though, is that the exported file is sized to the frame it was placed in.  In other words, if I placed a 3000x2000 px jpeg into a 320x240pt box, did some fitting options on it (say, fill Proportionally), then the exported image will be just that, 320x240.

How do I go about exporting these Graphics at full-resolution? IE: I want my exported PNG to be 3000x2000.

Suggestions?

Thanks.

This topic has been closed for replies.

4 replies

jeffmlevyAuthor
Known Participant
August 20, 2012

Yes, I have some other apps at my disposal, namely, ImageMagick. However, I don't want to use it. Notice the choice of words, "Want". I 'want' to do all my image processing on the indesign server.

Anyway, I found a solution, which works perfectly.

This is from a basic testcase, but obviously the code can be cleaned up.

d.allGraphics.each(function(graphic){

    var path = graphic.itemLink.filePath;

    var parent = graphic.parent;

    try {

        graphic.remove();

        parent.clearFrameFittingOptions();

        parent.place(File(path));

        parent.fit(FitOptions.FRAME_TO_CONTENT);

        parent.graphics[0].exportFile(ExportFormat.PNG_FORMAT, File(gf+"/"+parent.graphics[0].itemLink.name+".png"));

     } catch (error){

        alert("drink a beer.");

     }

});

Inspiring
August 20, 2012

You drink beer on error… Now that's all wrong… Coffee n fag try again on sucess… Have a beer…

Oooops… F A G ( different meaning in uk ) not allowed a cigarette then…

jeffmlevyAuthor
Known Participant
August 19, 2012

"An odd way to use ID…" -- That brought a smile to my face. Perhaps, odd, yes, but I've done worse, believe me.

There is a valid reason I have for not doing a collection, and pulling out the orginal assets/Links. I require them to be PNG.

InDesign server does a bang-up job at converting all EPS or AI or PSD files into PNG when I ask it to, but, it does so at a cost: It shrinks the exported/converted files to fit the size of their containing frames. Poo.

Here's a snipperoo of what I'm doing. Perhaps someone else has done the same, and figured out the full-size problem I'm facing.

This is part of a larger script, I've trimmed fat for brevity

(function(){

    var graphicExportDir = new Folder(source.path+"/graphics");

    graphicExportDir.exists||graphicExportDir.create();

    d.allGraphics.each(function(graphic){

        // Can I do something, here, to get my pal InDesign server to export at full-res?

        graphic.exportFile(ExportFormat.PNG_FORMAT, File(graphicExportDir+"/"+graphic.itemLink.name+".png"));

    })

})();

Inspiring
August 19, 2012

Got to say… I think you are using a sledge hammer to crack a nut… Have you no other apps at your disposal?

MrTIFF
Participating Frequently
August 19, 2012

If you placed a 3000 x 2000 px jpeg into InDesign, why not just use that image? Why try to export something new out of InDesign? Even if you are successful, you will typically lose quaity whenever you change the format or resolution of graphics data.

If this is really a display quality issue that you're having, note that the graphics display quality is controlled by View > Display Performance > High Quality Display.  And make sure that you haven't lost the links to the original graphics ... see the Window > Links panel.

Inspiring
August 19, 2012

The OP mentioned ID server ( i thought that was GUIless )… There are no ways to export *.ai or *.psd anyhows… Loop the links and copy the files as is…

Inspiring
August 18, 2012
An odd way to use ID… Why not just collect them instead…? *.ai & *.eps may not have any given resloution so to speak…