Copy link to clipboard
Copied
Hola,
AgradecerÃa si alguien me pudiese ayudar: necesito combinar más de 3000 pdf con su correspondiente portada.
La nomenclatura de los ficheros a combinar es:
nombredocumento.pdf
nombredocumentoPortada.pdf
Espero respuesta.
Muchas gracias
Copy link to clipboard
Copied
Assuming all the files are located in the same folder, create an Action via Tools - Action Wizard and add to it a command to run a JavaScript with the following code:
if (/portada/i.test(this.documentFileName)==false) {
this.insertPages(-1, this.path.replace(".pdf", "Portada.pdf"));
this.saveAs(this.path);
}
Now run it on your folder, and you're done.
Copy link to clipboard
Copied
Sorry, silly mistake on my part... Use this:
var newFileName = this.documentFileName.replace(".pdf", "_AV.pdf");
var newFilePath = this.path.replace(this.documentFileName, "AV/");
this.saveAs(newFilePath + newFileName);
Copy link to clipboard
Copied
Hi there
Hope you are doing well and thanks for reaching out. We are sorry for the trouble you are experiencing.
Would you mind sharing more details about the issue you are experiencing, what happens when you try to combine the PDFs Do you get any error message? If yes, please share the screenshot of the same for more clarity.
To know more about how to combine the PDFs and user guided actions please check the help pages listed below:
Let us know if you experience any trouble and need more help.
~Amal
Copy link to clipboard
Copied
Assuming all the files are located in the same folder, create an Action via Tools - Action Wizard and add to it a command to run a JavaScript with the following code:
if (/portada/i.test(this.documentFileName)==false) {
this.insertPages(-1, this.path.replace(".pdf", "Portada.pdf"));
this.saveAs(this.path);
}
Now run it on your folder, and you're done.
Copy link to clipboard
Copied
MuchÃsimas gracias try67, funcionó perfectamente.
Copy link to clipboard
Copied
Ahora, ya por completar el automatismo serÃa posible que me guardase los ficheros resultantes en una carpeta nueva y añadiendo al nombre, por ejemplo _AV.
Espero respuestas, pero si no es posible con esto ya avanzarÃa en el trabajo.
Muchas gracias
Copy link to clipboard
Copied
Unfortunately, it's not possible to create a new folder using a script. It can only save files to folders that already exist.
Copy link to clipboard
Copied
Muchas gracias
Copy link to clipboard
Copied
It is possible to save it under a different name (in the same folder, or another one), though.
Let me know and I'll adjust the code accordingly, if you wish.
Copy link to clipboard
Copied
Perfecto, entonces me gustarÃa que el documento resultante lo guardase con el mismo nombre pero añadiendo _AV al final ([nombre del archivo]_AV.pdf) y en una carpeta que crearé dentro de la carpeta donde se procesan y se llamará AV.
Gracias por las molestias
Copy link to clipboard
Copied
OK, then replace this line in the code above:
this.saveAs(this.path);
With this:
var newFileName = this.documentFileName.replace(".pdf", "_AV.pdf");
var newFilePath = this.path.replace(this.documentFileName, "/AV/");
this.saveAs(this, newFilePath + newFileName);
Edited: Fixed a small mistake in the code
Copy link to clipboard
Copied
Gracias try67, pero no funciona, me pregunta uno por uno de los archivos si deseo guardarlo si le digo que no, no hace nada y si le digo que hace lo mismo que hacÃa antes dejarlo en la misma carpeta y sin sufijo.
No te preocupes que tal y como estaba al princio me puedo apañar, de verdad muchas gracias
Copy link to clipboard
Copied
Are you sure the path is correct, and that the folder exists?
To prevent it from asking you to save the file, add this to the end of the code:
this.dirty = false;
Copy link to clipboard
Copied
Sorry, silly mistake on my part... Use this:
var newFileName = this.documentFileName.replace(".pdf", "_AV.pdf");
var newFilePath = this.path.replace(this.documentFileName, "AV/");
this.saveAs(newFilePath + newFileName);
Copy link to clipboard
Copied
Ahora funciona perfectamente, un millóoooooooon de gracias, si todos fuesen la mitad de buena gente que tú, el mundo serÃa un lugar maravilloso.
Un saludo,
Copy link to clipboard
Copied
De nada!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now