/* * clipboard2pdf.jsx for Illustrator CS3 * * A dokumentum méretét a vágólapon lévő anyag méretéhez igazítja, beilleszti * a vágólap tartalmát és EPS formátumba menti a saveOpts beállításainak megfelelően. * * A szkriptet Makó Tamás készítette * Szoftver Automatizálás * http://szoftverautomatizalas.hu/ * *** * * Copy the content of the clipboard into Illustrator, resize the doc's dimension * to the size of clipboard's data and save the doc as EPS using the preset (saveOpts). * * This script was constructed by Tamás Makó * Software Automation * http://softwareautomation.hu/products */ saveOpts = new EPSSaveOptions(); saveOpts.compatibility = Compatibility.ILLUSTRATOR12; saveOpts.embedAllFonts = true; tmpDoc = app.documents.add(); app.paste() tmpSelection = tmpDoc.selection; if ( tmpSelection.length > 0 ) { tmpGroupItem = tmpDoc.groupItems.add(); for ( i = 0; i < tmpSelection.length; i++ ) { item = tmpSelection[i].duplicate(); item.moveToBeginning( tmpGroupItem ); } tmpWidth = tmpGroupItem.width; tmpHeight = tmpGroupItem.height; tmpDoc.close(SaveOptions.DONOTSAVECHANGES); tmpDoc = app.documents.add(null, tmpWidth, tmpHeight); //DocumentColorSpace.RGB app.paste(); tmpFile = File.saveDialog("Save as EPS ..."); if (tmpFile!=null) { tmpDoc.saveAs(tmpFile, saveOpts); tmpDoc.close(SaveOptions.DONOTSAVECHANGES); } }