Solved

Adobe Acrobat sequ file, loop folder using variable

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

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…
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:/…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
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 …

687 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