How do I extract the PDF version of a PDF file using Visual Basic code?
Read bytes 6 to 8 of the file.
How do I read bytes 6 to 8 of the file?
Using whatever you’d normally use in VB. This is outside the abilities of the SDK.
So are you REALLY telling me the SDK does not have a built-in function to return the PDF version number? This surprises me!
I guess the answer would be to load the PDF into a text stream and read the version from the 6th to 8th byte?
thanks for your help.
Yes, I'm telling you that. The VB functions are VERY limited, but plug-ins written in C++ can do a lot more.
Take a look at the first line of a PDF in a text editor to see what I mean about version number.
Of course, you should know that the version in the header is NOT necessary the actual version. There is also a way for updating the version using the /Version key in the document catalog dictionary. That cannot be determined as easily (except via a plugin or library).