Class: Preflight::Rules::MaxInkDensity

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

Overview

Most CMYK printers will have a stated upper tolerance for ink density. If the total percentage of the 4 components (C, M, Y and K) is over that tolerance then the result can be unpredictable and often ugly.

Use this rule to detect CMYK ink densities over a certain threshold.

Arguments: the highest density that is Ok

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::MaxInkDensity, 300
end

TODO:

  • check CMYK colours used as alternates in a separation color

  • check CMYK raster images

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_ink) ⇒ MaxInkDensity

Returns a new instance of MaxInkDensity.



34
35
36
# File 'lib/preflight/rules/max_ink_density.rb', line 34

def initialize(max_ink)
  @max_ink = max_ink.to_i
end

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.



32
33
34
# File 'lib/preflight/rules/max_ink_density.rb', line 32

def issues
  @issues
end

Instance Method Details

#page=(page) ⇒ Object

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



40
41
42
43
44
# File 'lib/preflight/rules/max_ink_density.rb', line 40

def page=(page)
  @issues = []
  @page    = page
  @objects = page.objects
end

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



46
47
48
# File 'lib/preflight/rules/max_ink_density.rb', line 46

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

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



50
51
52
# File 'lib/preflight/rules/max_ink_density.rb', line 50

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