I'm trying to reduce a large number of pdf files to text format. Acrobat has a batch processing feature that will convert the files, and also allows a JavaScript to be executed as part of the conversion process. I would like to add JavaScript code that allows me to replace and/or remove certain text/characters from the file.

Examples would be:
A) Remove all double, triple, multi-spaces and carriage returns
B) Change all uppercase characters to lowercase
C) Remove all punctuation

What i'm really aiming for is to be able to run the batch process in Adobe, then have a javascript filter out all that junk within a file with X amount of lines, not just one.


I've very new to JavaScript, so I appologize in advance.

For B, there is .toLowerCase() . For A and C, you could use a regular expression. Hint: \s stands for whitespace :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.