Class: Preflight::Rules::NoPageRotation

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

Overview

Ensure the target file contains no page rotation.

Rotating pages is generally acceptable in most specs but it can cause rendering issues with poor waulity PDF consumers.

Arguments: none

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::NoPageRotation
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.



23
24
25
# File 'lib/preflight/rules/no_page_rotation.rb', line 23

def issues
  @issues
end

Instance Method Details

#page=(page) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/preflight/rules/no_page_rotation.rb', line 25

def page=(page)
  attrs = page.attributes

  if attrs[:Rotate] && page.objects.deref(attrs[:Rotate]) != 0
    @issues = [Issue.new("Page is rotated", self, :page => page.number)]
  else
    @issues = []
  end
end