// Detect It Easy: detection rule file
// Author: horsicq <horsicq@gmail.com>

meta("format", "PDF");

function detect() {
    if (/^\%PDF-\d+\.\d+/.test(File.read_ansiString(0, 10))) {
        sVersion = File.getString(5, 3);
        bDetected = true;

        var c = 0;
        for (i = 8; i < 15; i++)
            if (File.read_uint8(i) & 0x80) c++;

        if (c) sOptions = "binary data";
    }

    return result();
}