PDA

View Full Version : how to get a PDF's "creation date" ?



benjilac
09-03-2010, 12:55 AM
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 :)

Bob Phillips
09-03-2010, 01:18 AM
Const BASE_DIR As String = "C:\MyDir\"

MsgBox CreateObject("Scripting.FilesystemObject").GetFile( _
BASE_DIR & "MyFile.pdf").DateLastModified

p45cal
09-03-2010, 02:36 AM
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:
theDate = filedatetime("c:\myDirectory\2010-08-28_093240.png")
in excel vba. Don't know if it's truly creation date, more last modified date.

benjilac
09-03-2010, 03:08 AM
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:)

Bob Phillips
09-03-2010, 03:11 AM
Apart from being on different tabs, what is the difference in those two dates?

benjilac
09-03-2010, 03:43 AM
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:)

p45cal
09-03-2010, 03:47 AM
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.

Kenneth Hobs
09-03-2010, 06:03 AM
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.

GregB
04-09-2012, 08:03 AM
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);