public char checkPdfHeader() throws IOException {
file.setStartOffset(0);
String str = readString(1024);
int idx = str.indexOf("%PDF-");
if (idx < 0)
throw new InvalidPdfException(MessageLocalization.getComposedMessage("pdf.header.not.found"));
file.setStartOffset(idx);
return str.charAt(idx + 7);
}