Excel Hints

Results 1 to 9 of 9

Thread: how to get a PDF's "creation date" ?

  1. #1

    how to get a PDF's "creation date" ?

    Hi everyone,
    I know very few things in VBA and I need to know something:

    I would like to get the "creation date" of a PDF.
    When you right click on a PDF file you have a window with 3 tabs: I need to get the "creation date" that is in the second tab called "PDF" (not the first one called "general").
    do you know if that is possible ?
    Thanks a lot for your help

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master xld's Avatar
    Joined
    Apr 2005
    Posts
    24,066
    Location
    VB:
     
     
    Const BASE_DIR As String = "C:\MyDir\" 
     
    MsgBox CreateObject("Scripting.FilesystemObject").GetFile( _ 
    BASE_DIR & "MyFile.pdf").DateLastModified 
    
    
    Formatting tags added by mark007
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Quote Originally Posted by benjilac
    Hi everyone,
    I know very few things in VBA and I need to know something:

    I would like to get the "creation date" of a PDF.
    When you right click on a PDF file you have a window with 3 tabs: I need to get the "creation date" that is in the second tab called "PDF" (not the first one called "general").
    do you know if that is possible ?
    Thanks a lot for your help
    You could also explore the likes of:
    VB:
    theDate = filedatetime("c:\myDirectory\2010-08-28_093240.png") 
    
    
    Formatting tags added by mark007
    in excel vba. Don't know if it's truly creation date, more last modified date.
    p45cal - - - - -This is my signature, it appears after all my posts. Below is not directed at anyone in particular - so don't take offence! - (You might guess why it's there though)
    If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    thank you very much for your help.

    But the codes you sent actually give me the last modified date (or creation date) for the windows system point of view. (corresponding to the first "general tab" you have when you right click on the PDF file to get the file properties).

    In my case, I would like to get the last modified date or creation date that is in the second tab called "PDF". (this date is different from the date you can find in the "general tab")

    I dont know if that's possible

    Thank you very much

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master xld's Avatar
    Joined
    Apr 2005
    Posts
    24,066
    Location
    Apart from being on different tabs, what is the difference in those two dates?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    the date within "PDF" tab is the actual creation date from the original author. Then the date you can find in "general" tab can differ from the first one.

    Exemple: you download a PDF on the internet and save it on your desktop. If you go check the file properties, in "general" tab you will today's date, and if you go on the "PDF" tab you will find the original creation date from the author.

    it seems that this specific date is encrypted within the PDF as I read here (page 844):
    adobe.com/devnet/acrobat/pdfs/pdf_reference_1-7.pdf

    But I am not good enough to find a way to get it..

    thank you so much

  7. #7
    I don't know that this is the creation date of the pdf… it seems, on exploring some of the pdf files people have sent me in the past, that it might be the creation date of the document that was used to create the pdf?
    I have no idea how to extract it.
    Last edited by p45cal; 09-03-2010 at 05:24 AM.
    p45cal - - - - -This is my signature, it appears after all my posts. Below is not directed at anyone in particular - so don't take offence! - (You might guess why it's there though)
    If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  8. #8
    You will need to get Adobe Distiller or a DLL to extract it. If you find a DLL with a function to do it, post back and someone can help at that point. Those DLL's are usually not free.

  9. #9
    Benjilac,
    I know it has been a while since this post. But if you are still out there, I would love to know if you found a solution to your challenge regarding the PDF creation dates. I've a couple thousand PDFs that I need to sort. Can you help?

    Thanks,
    GregB vbmenu_register("postmenu_223907", true);

Posting Permissions

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