Class: Preflight::Rules::OutputIntentForPdfx

Inherits:
Object
  • Object
show all
Defined in:
lib/preflight/rules/output_intent_for_pdfx.rb

Overview

Check the target PDF contains an output intent suitable for PDFX

Arguments: none

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::OutputIntentForPdfx
end

Instance Method Summary collapse

Instance Method Details

#check_hash(ohash) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/preflight/rules/output_intent_for_pdfx.rb', line 20

def check_hash(ohash)
  intents = output_intents(ohash).select { |dict|
    ohash.object(dict)[:S] == :GTS_PDFX
  }

  if intents.size != 1
    [Issue.new("There must be exactly 1 OutputIntent with a subtype of GTS_PDFX", self)]
  else
    []
  end
end