Skip to main content
Participant
January 16, 2023
Question

Exporting separate eps/png files from indesign with custom name

  • January 16, 2023
  • 1 reply
  • 474 views

You used to be able to export seperate eps/png files from Indesign with custom names using a paragraph style. Does anyone know if this is still possible or how to do it? Thanks

This topic has been closed for replies.

1 reply

Steve Werner
Community Expert
Community Expert
January 16, 2023

I don't believe there has been a change about the Export PNG dialog. It has always looked like this:

 

 

Perhaps you were using a script or extension?

Participant
January 16, 2023

Thank you. I thought there was a way to do it in Indesign without having to import a script. 

Legend
January 16, 2023

Hello @Tamsin27960274812i 

 

The below script will export each page as a seperate eps and png file from Indesign with custom names using the paragraph style "file_name".

You'll have adjust the export preferences to your requirments...

doc = app.documents[0];
var PNG_Folder = Folder(doc.filePath + '/PNG');
var EPS_Folder = Folder(doc.filePath + '/EPS');

if (!PNG_Folder.exists) {
    PNG_Folder.create(); 
}
 
if (!EPS_Folder.exists) {
    EPS_Folder.create(); 
}

    for(var p = 0; p < app.documents[0].pages.length; p++) {  
        var frames = app.documents[0].pages[p].textFrames;
        var myPageName = app.documents[0].pages[p].name;  
        var file_name = null;  
          
    for(var i = 0; i < frames.length; i++) { 
      try {if(frames[i].paragraphs[0].appliedParagraphStyle.name == 'file_name') {  
        file_name = frames[i].paragraphs[0].contents;  
         break;  
        }
        }catch (e){
     }  
  }

   if (file_name == null) { 
    alert ('Error!\nThe Paragraph Style "file_name" is not applied to one or more of the pages or is Labeled Incorrectly.');
    exit();
    }
      
  if(file_name != null) {  

// eps export preferences
app.epsExportPreferences.pageRange = String(myPageName);
app.epsExportPreferences.epsColor = EPSColorSpace.CMYK;
app.epsExportPreferences.dataFormat = DataFormat.ASCII;
app.epsExportPreferences.postscriptLevel = PostScriptLevels.LEVEL_2;
app.epsExportPreferences.preview = PreviewTypes.TIFF_PREVIEW;
app.epsExportPreferences.fontEmbedding = FontEmbedding.SUBSET;
app.epsExportPreferences.bleedTop = 0;
app.epsExportPreferences.bleedBottom = 0;
app.epsExportPreferences.bleedInside = 0;
app.epsExportPreferences.bleedOutside = 0;
app.epsExportPreferences.appliedFlattenerPreset = "[High Resolution]";


doc.exportFile(ExportFormat.EPS_TYPE,File(EPS_Folder + "/" + file_name + ".eps"),false);

// png export preferences
    app.pngExportPreferences.antiAlias = true;
    app.pngExportPreferences.exportResolution = 72;
    app.pngExportPreferences.pngColorSpace = PNGColorSpaceEnum.RGB;
    app.pngExportPreferences.pngExportRange = PNGExportRangeEnum.EXPORT_RANGE;
    app.pngExportPreferences.pngQuality = PNGQualityEnum.MAXIMUM;
    app.pngExportPreferences.simulateOverprint = true;
    app.pngExportPreferences.transparentBackground = false;
    app.pngExportPreferences.useDocumentBleeds = false;
    app.pngExportPreferences.pageString = String(myPageName);


doc.exportFile(ExportFormat.PNG_FORMAT, File(PNG_Folder + '/' + file_name + ".png"),false);
  }
}
alert("Done exporting files!")

Regards,

Mike