refactor main to function PDFormat, change some
of the names.
got most of the read header functionality going; it seems to
read the offsets, etc. fine on my sample data.