You can easily export a document to *.jpeg format using extendscript… There are options for horizontal and vertical scales what you can't alter by script is the resolution always 72dpi
But i want to change the size of input AI while converting it to JPEG
this is all i want to do.
i am using the following code:
var docRef = app.activeDocument;
var srcFile = app.activeDocument.fullName;
var dstFile = app.activeDocument.path+"/"+app.activeDocument.name;
//var dstFile = "D:/"+app.activeDocument.name;
var ej = new ExportOptionsJPEG();
ej.Optimization = true;
ej.QualitySetting = 60;
for(var i=0; i<docRef.rasterItems.length;i++)
docRef.exportFile(new File (dstFile), ExportType.JPEG, ej);
but i am not sure this will work in every condition.
i need a perfect solution for it because some AI files mightnot have RasterItems in it, that will create a problem while resizing the document.
Please guid me.
I don't understand what exactly you are doing here? You have created a loop but only change the first raster… you export after the loop so only one file… There are option to size in the export and you have not used them. I think a better description or a screen grab would help…