I want to convert a AI file into a JPEG by using JSX(java script)
i am able to change its file type but having some problem with resizing
can anyone please suggest me some solution.
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…
Europe, Middle East and Africa