These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Batch sequence javascript 2 slide per page

lulanglo
Registered: Jan 8 2009
Posts: 3

Hello everyone,

I am fairly new to batch processing and javascript, my knowledge in both is really limited and I have some problem with a javascript i'd like to use.

My need is simple: We have tons and tons of Powerpoint documents we need to convert weekly to PDF format, the batch processing in Adobe Acrobat 9.0 work like a charm but there is only one setting I cannot find, we absolutly need to convert them in the format of 2 slide per page vertical.

I have found the script below but due to some security in Acrobat (I think) the batch work but it prompt for save at every file.

pp = this.getPrintParams();
pp.pageHandling = pp.constants.handling.nUp;
pp.nUpPageOrders = pp.constants.nUpPageOrders.Horizontal;
pp.nUpNumPagesH = 0;
pp.nUpNumPagesV = 2;
pp.nUpPageBorder=true;
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "Adobe PDF";
this.print(pp);

The 2 problems I have with the script:

1. It prompt the windows file saving window for every file, making the batch processing kind of useless.

2. the script create 2 copy of the file one with the actual name of the file and another one that look like a temp file named ADP602.pdf incrementing the number every file.

My question is :

what modification should I made to the script or is there any simplier alternative to convert a massive amount of PPT in PDF format using the 2 slide per page option ?

Thank you very much for your help.

Regards,

Luc Langlois

My Product Information:
Acrobat Pro 9.0, Windows
lulanglo
Registered: Jan 8 2009
Posts: 3
After reading on Adobe security and trusted function I tried doing it this way :

Created a file named print.js on the user folder
C:\Documents and Settings\[username]\Application Data\Adobe\Acrobat\9.0\JavaScripts

this is the piece of code inside the file:

Print1 = app.trustedFunction(
function (pp ) {
app.beginPriv();
this.print(pp)
app.endPriv();
}
)

Then I made a batch process with a javascript command, the command is :

/* PPT to PDF */

var pp = this.getPrintParams();
pp.pageHandling = pp.constants.handling.nUp;
pp.nUpPageOrders = pp.constants.nUpPageOrders.Horizontal;
pp.nUpNumPagesH = 0;
pp.nUpNumPagesV = 2;
pp.nUpPageBorder=true;
pp.interactive = pp.constants.interactionLevel.silent;
pp.printerName = "Adobe PDF";
sPrint1();

unfortunatly i have the same problem.... acrobat prompt the save as.. context window and create 2 file one with the full name and one with a random name.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First, it's the Adobe PDF printer that pops up the SaveAs dialog. This has nothing to do with Acrobat or JavaScript. There is no way to pass a file name into the Adobe PDF printer. You might think that the "fileName" parameter would do this, but unfortunately it doesn't.

I thought that maybe changing the Adobe PDF printer settings would help, i.e., setting it up to automatically print to a specified file name and folder, but these setting were reset whenever the print was done from JavaScript or batch processing. I think this must be a bug in the printer or in Acrobat.

I also thought that you could just print to postscript, which can be done silently. Reconverting back to PDF is simple and can be done from a script. Unfortunately it appears that Acrobat will not print tiled pages to postscript. I'm sure this must be a bug as well.

But there is a solution, there is a PDF page tiling tool at www.pdfscripting.com (look in the downloads area), you could easily convert this JavaScript automation tool for use in a batch process. Or I could do it. You have to be a member to download. If you sign up let me know and I can set you up for using it in a batch process.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script