documentcloud/docsplit — pull request #102 by tmaier (2014-02-19 13:59:04+00:00)
Title: Check if file is PDF by magic number. Closes #98

It only reads the first line of the file and compares it with a regex.

According to the [PDF reference][1] (page 92) the first line shall contain any of this strings:

```
%PDF−1.0
%PDF−1.1
%PDF−1.2
%PDF−1.3
%PDF−1.4
%PDF−1.5
%PDF−1.6
%PDF−1.7
...
```

[1]: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_1-7.pdf

Related to #48, #50 (`.skip_ensure_pdfs` should be obsolete) and #98