Class: Preflight::Rules::NoRgb

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

Overview

Some print workflows forbid the use of RGB colour.

Arguments: none

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::NoRgb
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_rgb.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_rgb.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_rgb.rb', line 33

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

#set_nonstroke_color_space(label) ⇒ Object



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

def set_nonstroke_color_space(label)
  check_color_space(label)
end

#set_rgb_color_for_nonstroking(r, g, b) ⇒ Object



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

def set_rgb_color_for_nonstroking(r, g, b)
  rgb_detected(r, g, b)
end

#set_rgb_color_for_stroking(r, g, b) ⇒ Object



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

def set_rgb_color_for_stroking(r, g, b)
  rgb_detected(r, g, b)
end

#set_stroke_color_space(label) ⇒ Object



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

def set_stroke_color_space(label)
  check_color_space(label)
end