Solved

Adobe Acrobat sequ file, loop folder using variable

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now