¿Puede alguien ayudarme con un script de Illustrator que pueda convertir texto de varios archivos en una carpeta en esquemas y guardarlo en PDF con un ajuste preestablecido específico de mi elección?
Pude encontrar algunas líneas de código a partir de mi investigación en los foros de Adobe, pero no pude combinarlas para que funcionaran de alguna manera.
Lo que he encontrado:
https://forums.adobe.com/thread/964576
#ilustrador de destino
función esquemaDocText( ) {
if ( app.documents.length == 0 ) return;
var docRef = app.documentoactivo;
recurseLayers( docRef.layers );
};
esquemaDocTexto();
function recurseLayers(objArray) {
for ( var i = 0; i < objArray.length; i++ ) {
// Record previous value with conditional change
var l = objArray[i].locked;
if ( l ) objArray[i].locked = false;
// Record previous value with conditional change
var v = objArray[i].visible;
if ( !v ) objArray[i].visible = true;
outlineText( objArray[i].textFrames );
// Recurse the contained layer collection
if ( objArray[i].layers.length > 0 ) {
recurseLayers( objArray[i].layers )
}
// Recurse the contained group collection
if ( objArray[i].groupItems.length > 0 ) {
recurseGroups( objArray[i].groupItems )
}
// Return to previous values
objArray[i].locked = l;
objArray[i].visible = v;
}
};
function recurseGroups(objArray) {
for ( var i = 0; i < objArray.length; i++ ) {
// Record previous value with conditional change
var l = objArray[i].locked;
if ( l ) objArray[i].locked = false;
// Record previous value with conditional change
var h = objArray[i].hidden;
if ( h ) objArray[i].hidden = false;
outlineText( objArray[i].textFrames );
// Recurse the contained group collection
if ( objArray[i].groupItems.length > 0 ) {
recurseGroups( objArray[i].groupItems )
}
// Return to previous values
objArray[i].locked = l;
objArray[i].hidden = h;
}
};
función textoutout(objArray) {
// Reverse this loop as it brakes the indexing
for ( var i = objArray.length-1; i >= 0; i-- ) {
// Record previous value with conditional change
var l = objArray[i].locked;
if ( l ) objArray[i].locked = false;
// Record previous value with conditional change
var h = objArray[i].hidden;
if ( h ) objArray[i].hidden = false;
var g = objArray[i].createOutline( );
// Return new group to previous Text Frame values
g.locked = l;
g.hidden = h;
}
};
Gracias.
Pude conseguir lo que quería. Convierta trazos y texto en contornos y guarde todos los archivos en PDF X-3. Usó algunas partes del código de otras preguntas y respuestas relacionadas con problemas similares. Aquí está lo que funcionó para mí:
try {
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
if (app.documents.length > 0 ) {
var destFolder = null;
destFolder = Folder.selectDialog( 'Select folder for PDF files.', '~');
if (destFolder != null) {
var options, i, sourceDoc, targetFile;
options = this.getOptions();
while (app.documents.length > 0) {
sourceDoc = app.activeDocument
app.executeMenuCommand("selectall");
app.executeMenuCommand("OffsetPath v22");
app.executeMenuCommand("outline");
targetFile = this.getTargetFile(sourceDoc.name, '.pdf', destFolder);
sourceDoc.saveAs( targetFile, options );
app.activeDocument.close();
}
alert( 'Documents saved as PDF' );
}
}
else{
throw new Error('There are no document open!');
}
}
catch(e) {
alert( e.message, "Script Alert", true);
}
function getOptions()
{ var NamePreset = '[PDF/X-3:2002]';
var options = new PDFSaveOptions();
options.pDFPreset=NamePreset;
return options;
}
function getTargetFile(docName, ext, destFolder) {
var newName = "";
if (docName.indexOf('.') < 0) {
newName = docName + ext;
} else {
var dot = docName.lastIndexOf('.');
newName += docName.substring(0, dot);
newName += ext;
}
var myFile = new File( destFolder + '/' + newName );
if (myFile.open("w")) {
myFile.close();
}
else {
throw new Error('Access is denied');
}
return myFile;
}
joojaa
Joonas
Convert fonts to outlines
en Acrobat Pro.