Class: Preflight::Rules::CropboxMatchesMediabox

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

Overview

Every page should have a CropBox that matches the MediaBox

Arguments: none

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::CropboxMatchesMediabox
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.



20
21
22
# File 'lib/preflight/rules/cropbox_matches_mediabox.rb', line 20

def issues
  @issues
end

Instance Method Details

#page=(page) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/preflight/rules/cropbox_matches_mediabox.rb', line 22

def page=(page)
  @issues = []
  dict = page.attributes

  if dict[:CropBox] && round_off(dict[:CropBox]) != round_off(dict[:MediaBox])
    @issues << Issue.new("CropBox must match MediaBox", self, :page => page.number)
  end
end