Solved

Batch Sequence Page Extraction Using Javascript For Adobe Acrobat

Posted on 2004-10-05
5
663 Views
Last Modified: 2013-12-16
Can someone tell me how I need to alter this javascript (which parameters to change to what, errors, etc) to allow Adobe Acrobat to execute it to extract pages from multiple-page documents? I extract them as hx-area-1.pdf, hx-area-2.pdf, etc, etc. There are several multiple-page reports (made into pdf's in Access) that need to be extracted to single pages in Acrobat. Thank you!

/* Extract Pages to Folder */
// regular expression acquire the base name of file
var re = /.*\/|\.pdf$ig;
var filename + this.path.replace(re," ") ;

try
{
      for ( var i = 0; i < this.numPages; i++)
      this.extractPages
      ({
            nStart: i,
            cPath: "/Paulnext/AC/Java/"+filename+"_" +".pdf"     // (X)
      });
catch (e)
{
      console.println(Batch Aborted: " + e )
}
0
Comment
Question by:APConnextion
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:APConnextion
ID: 12228851
I should also mention that (depending on your familiarity with Adobe Acrobat) Acrobat selects the list of files to process outside the javascript, as well as where to put them. It gives me an option of what to put before the original name and after it, but the numbers of the pages need to sequentially advance (ex. Pages from hx-area-1.pdf, Pages from hx-area-2.pdf, etc) - which it might do intuitively if the above code was altered appropriately, but I'm not sure. Hopefully someone can help? Thank you.  
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 12229009
i don't know if this is the problem but you are missing a quote here:

   console.println( "Batch Aborted: " + e )
0
 

Author Comment

by:APConnextion
ID: 12229178
knightEknight - You were right. There were also a couple other (one \ and one }) things missing that I added in since posting. But that was the exact error I was on when you responded! Thanks! Now - I still have a problem. The javascript executes, but it is extracting the entire file to another file (say there are 4 pages, and I want them extracted to 4 single page .pdfs) - it is currently extracting all 4 pages to another folder as a .pdf with 4 pages). Basically, it's making a copy of the pdf in another folder. But I need each page extracted seperately. I hope I've explained this properly. Can you help? The code must be missing someething . . .
0
 

Author Comment

by:APConnextion
ID: 12230319
Actually, I finally figured it out! But you got me through the debugging, knight, so you get the points.  Thanks!
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12230823
glad I could help in some small way :)
thanks for the points!
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question