/* * 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 PDF 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 PDF using the preset (saveOpts). * * This script was constructed by Tamás Makó * Software Automation * http://softwareautomation.hu/products */ saveOpts = new PDFSaveOptions(); saveOpts.compatibility = PDFCompatibility.ACROBAT6; saveOpts.generateThumbnails = false; saveOpts.colorCompression = CompressionQuality.ZIP8BIT saveOpts.grayscaleCompression = CompressionQuality.ZIP8BIT saveOpts.monochromeCompression = MonochromeCompression.MONOZIP 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 PDF ..."); if (tmpFile!=null) { tmpDoc.saveAs(tmpFile, saveOpts); tmpDoc.close(SaveOptions.DONOTSAVECHANGES); } }