Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 646

Are PDF headers all the same regardless of version

$
0
0

I am validating a PDF upload via the header info. I have outputted the header portion that i need to check and that return value is %PDF-1.4

I know there are several ways to do this, i can use strpos or i can use substr to pull 0 thru 3 and check for %PDF to validate it.

My question is do all PDF file headers contain %PDF within the first 7 positions. I am pulling 7 because i need the extra to also check for other file types i am validating.

Is %PDF version specific or is that global? I know i could just use strpos for PDF but if i can be more specific then my validation will be more valid. Actually if all of them were %PDF-1 that would be more specific as well and more valid.


Viewing all articles
Browse latest Browse all 646

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>