Solved

Adobe Acrobat sequ file, loop folder using variable

Posted on 2013-10-28
3
534 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 42

Expert Comment

by:Rob Jurd, EE MVE
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

832 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