Solved

Adobe Acrobat sequ file, loop folder using variable

Posted on 2013-10-28
3
542 Views
Last Modified: 2013-10-29
Hi there,

We are trying to achieve the following using Adobe Acrobat sequ file:
- loop a folder with a few thousand PDFs
- for each file check the file name for the language (e.g. the English file names always end in _en.pdf, the Spanish file names always end in _es.pdf)
- combine 2 files, one of the 7000 above with an language ending and then a standard disclaimer, 6 diclaimer files are available, one for each language. These files have a fixed path.

How can you achieve this using 6 or even better 1 sequ file?

Any help appreciated.
0
Comment
Question by:riffrack
3 Comments
 
LVL 43

Expert Comment

by:Rob
ID: 39608066
Do you have anything to go on?  Have you read the manual? http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/batch_sequences.pdf

I can help you work through this but it would be good to go with some code if you've got it.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 39608298
Unfortunately the reply provided by tagit was not very helpful. Here is some code that you can use as the basis for your experimentation.

To do this, bring up the Action Wizard, and move the "Execute JavaScript" processing step in the "More Tools" category to your action:

Screen shot
Then, use this code:

// this is the base file name of the language specific files that we are adding to the 
// documents that are getting processed
var baseName = "/c/temp/DetectLanguage/info";   // we will add e.g. _en.pdf to this string

// get the filename of the current document
var thePath = this.path;

// the path looks like this: /c/directory/name_en.pdf - to get the language, we are looking for 
// _en.pdf, _de.pdf and so on at the end of the string

var re = /_(\w\w).pdf/;

var match = re.exec(thePath);

if (match != null) {
    var insertFile = baseName + "_" + match[1] + ".pdf";
    this.insertPages( { nPage:this.numPages-1, cPath:insertFile });
}

Open in new window


You will have to modify the way the language is stored (I assume a two letter language code at the end of the filename, just before the extension), and where our disclaimer files are stored and what they are named.

As usual, the Acrobat JavaScript reference document is your friend, if you run into problems, try to find the function that is causing the problems in the reference and make sure that you are passing the right information to the function.

Hope this helps.
0
 

Author Closing Comment

by:riffrack
ID: 39608637
Thanks for the help, works perfectly.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

730 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