Class: PDFValidator
- Inherits:
-
Object
- Object
- PDFValidator
- Defined in:
- lib/pdf_validator.rb
Overview
A crude validator for PDF files.
Class Method Summary collapse
-
.valid?(string) ⇒ Boolean
ISO 32000-1:2008 Section 7.5.2.
Class Method Details
.valid?(string) ⇒ Boolean
ISO 32000-1:2008 Section 7.5.2. states: “The first line of a PDF file shall be a header consisting of the 5 characters %PDF-”
This is not proof that the contents describe a PDF file, but it’s a good approximation.
11 12 13 |
# File 'lib/pdf_validator.rb', line 11 def self.valid?(string) string.start_with?('%PDF-') end |