...

View Full Version : PDF Properties



kerepuki
07-17-2007, 08:20 AM
Hey peps,

I was wondering if anyone has any code to read a PDF file name, split it up and update property values depending on the file name.

Example: I have about 10,000 pdf's that have been uploaded to our site but the names are incorrect as we are running searches and filters.

catstockbroking30082005-14292.pdf will need to be broken up into:

Title Property: 14929
Keywords Property: Stock Broking
Date Property: 30/08/2005

catmanaged03062003-02-12036.pdf will need to be broken up into:

Title Property: 12036
Keywords Property: Managed Investments
Date Property: 03/06/2003

etc.

Thanks

matthewlesh
07-17-2007, 12:02 PM
i know this is me a php programmer... but wouldn't it be easiest to use php?

Philip M
07-17-2007, 12:03 PM
This should give you a start:-

<script type ="text/javascript">

var text = "catstockbroking30082005-02-14292.pdf"
var title = "";
var date = "";
var keyword = "";
text = text.replace(/^(cat)/,""); // remove cat at start of string
text = text.replace(/(\.pdf)$/,""); // remove.pdf at end of string
title = text.match(/\d{5}$/); // now title is last five digits
title = title.toString();
text = text.replace (/\-\d{5}/,"") // remove title from text string
date = text.match(/\d{8}/); // find date digits
date = date.toString();
date = date.substr(0,2) + "/" + date.substr(2,2) + "/" + date.substr(4,4);
keyword = text.replace(/[\d\-]/g,""); // remove date digits leaving keyword
alert (title + " " + keyword + " " + date);

</script>

"Please" before you get help, "Thanks" afterwards is usually thought to be polite.

kerepuki
07-20-2007, 05:30 AM
Hi, sorry, please, thanks.

I should have been more clear. I need a script to run inside acrobat batch process option to update a folder full of files.

Thanks again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum