Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: PDF Properties

  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PDF Properties

    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

  • #2
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i know this is me a php programmer... but wouldn't it be easiest to use php?

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,919
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    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.
    Last edited by Philip M; 07-17-2007 at 11:56 AM.

  • #4
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •