Consulting

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 Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    Location
    [vba]


    Const BASE_DIR As String = "C:\MyDir\"

    MsgBox CreateObject("Scripting.FilesystemObject").GetFile( _
    BASE_DIR & "MyFile.pdf").DateLastModified
    [/vba]
    ____________________________________________
    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
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    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:
    [VBA]theDate = filedatetime("c:\myDirectory\2010-08-28_093240.png")[/VBA]
    in excel vba. Don't know if it's truly creation date, more last modified date.
    p45cal
    Everyone: 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 Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    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
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    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
    Everyone: 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
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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
    VBAX Regular
    Joined
    Jan 2012
    Posts
    10
    Location
    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
  •