Class: Preflight::Rules::NoCmyk

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/preflight/rules/no_cmyk.rb

Overview

Some print workflows forbid the use of CMYK colour.

Arguments: none

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::NoCmyk
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.



29
30
31
# File 'lib/preflight/rules/no_cmyk.rb', line 29

def issues
  @issues
end

Instance Method Details

#invoke_xobject(label) ⇒ Object

descend into nested form xobjects



42
43
44
45
46
47
48
49
50
51
# File 'lib/preflight/rules/no_cmyk.rb', line 42

def invoke_xobject(label)
  @state.invoke_xobject(label) do |xobj|
    case xobj
    when PDF::Reader::FormXObject then
      xobj.walk(self)
    when PDF::Reader::Stream then
      check_xobject(xobj)
    end
  end
end

#page=(page) ⇒ Object

we’re about to start a new page, reset state



33
34
35
36
37
38
# File 'lib/preflight/rules/no_cmyk.rb', line 33

def page=(page)
  @page   = page
  @state  = PDF::Reader::PageState.new(page)
  @issues = []
  @resource_labels_seen = []
end

#set_cmyk_color_for_nonstroking(c, m, y, k) ⇒ Object



57
58
59
# File 'lib/preflight/rules/no_cmyk.rb', line 57

def set_cmyk_color_for_nonstroking(c, m, y, k)
  cmyk_detected(c, m, y, k)
end

#set_cmyk_color_for_stroking(c, m, y, k) ⇒ Object



53
54
55
# File 'lib/preflight/rules/no_cmyk.rb', line 53

def set_cmyk_color_for_stroking(c, m, y, k)
  cmyk_detected(c, m, y, k)
end

#set_nonstroke_color_space(label) ⇒ Object



65
66
67
# File 'lib/preflight/rules/no_cmyk.rb', line 65

def set_nonstroke_color_space(label)
  check_color_space(label)
end

#set_stroke_color_space(label) ⇒ Object



61
62
63
# File 'lib/preflight/rules/no_cmyk.rb', line 61

def set_stroke_color_space(label)
  check_color_space(label)
end