Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2007-09-17 11:57:24

gio6488
Member
Registered: 2007-09-12
Posts: 2

PDF Batch Processing, JavaScript

I am starting out with this. My objective is to run
a Acrobat batch script to sort by Layered and not layered hopefully target dir
to save output file accordingly.
While I am in there Turn a Layer default off.
My layer off is working. I need to run this unattended with

success confirmation and
Error handling and 
Append all to 1 report.

Currently I get 1 per file and have not worked out the sort/save

Any help would be appreciated 

/* Lyr RPT Mod Test */
var rep = new Report();
rep.size = 1.2;
rep.color = color.blue;
rep.writeText ("Testing for Content");
rep.writeText("FileName : " + this.documentFileName);
for (var i = 0; i < this.numPages; i++ ) // loop thru all pages
{
var a = this.getAnnots();
var c = this.getOCGs();
var b = this.getPageBox("Crop", i);
var l = this.getLinks(i, b);
var ocgs = this.getOCGs();
for (var i=0; i


My Product Information:
Acrobat Pro 8.1 / Windows

Offline

 

#2 2007-09-24 19:25:17

thomp
Member

Registered: 2007-04-23
Posts: 1027

Re: PDF Batch Processing, JavaScript

You code was cut off.  Please repost with all the "less than" and "greater than" symbols replaced by lt and gt. I have to warn you though that this is not a free consulting service.  We give general advice and answers to specific questions. We do not analyze code.  Here's some general advice.

If your current algorithm is working then you can use it in a batch process, although the methodology is a bit awkward.  You'll need to separate the parts of the code that create and finish the report from the code that operates on the documents.  Place this code in two separte menu items or toolbar buttons. Change the code so that the Report object is assigned to a "Global" variable.  If your on Acrobat 8 you will need to set the JavaScript preference that allow the Global object to be used accross documents.

The sequece for using the batch script is:

1.  Execute menu item that sets up Report Object.
2.  Run Batch Process
3. Execute menu item that finishes off report.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in