Programatically discover the version of a pdf file
-
I would like to write a little helper app to identify pdf files in a shared folder that have been saved as version 1.5, as they should be 1.4 or earlier to be accessible to Acrobat Reader v5 I have been looking at using FileInfo - but I guess the metadata to identify the pdf version is hidden a little deeper? Can anyone point me in the right direction?
-
I would like to write a little helper app to identify pdf files in a shared folder that have been saved as version 1.5, as they should be 1.4 or earlier to be accessible to Acrobat Reader v5 I have been looking at using FileInfo - but I guess the metadata to identify the pdf version is hidden a little deeper? Can anyone point me in the right direction?
Hi, AFAIK PDF files start with an "eye catcher" string that contains the version number. For 1.5 it is "25 50 44 46 2D 31 2E 35 0D" in hex byte values ("%PDF-1.5"+CR). So you should open and read the first few bytes and compare. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Happy 2008!
-
Hi, AFAIK PDF files start with an "eye catcher" string that contains the version number. For 1.5 it is "25 50 44 46 2D 31 2E 35 0D" in hex byte values ("%PDF-1.5"+CR). So you should open and read the first few bytes and compare. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Happy 2008!
//Works like a charm! Ta muchly! // :-D Ignore my previous response! Having written and executed my little applet, I didn't get any results. Which was odd, because I knew there were at least a few of these rogue files. On further investigation, it appears that the string says they are 1.4 - but are being reported on the properties-pdf tab as version 1.5. I'll dig a little deeper and get back to you.
modified on Friday, January 11, 2008 8:14:52 AM