Class: Preflight::Rules::NoPrivateData

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

Overview

Ensure the target file contains no private application data.

PDF generating apps (like Adobe Illustrator) can embed their own private data in saved PDFs. This data is generally harmless and ignored by all other PDF consumers, but it can lead to large increases in file size.

Arguments: none

Usage:

class MyPreflight
  include Preflight::Profile

  rule Preflight::Rules::NoPrivateData
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#issuesObject (readonly)

Returns the value of attribute issues.



24
25
26
# File 'lib/preflight/rules/no_private_data.rb', line 24

def issues
  @issues
end

Instance Method Details

#page=(page) ⇒ Object



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

def page=(page)
  attrs = page.attributes

  if attrs[:PieceInfo]
    @issues = [Issue.new("Page contains private PieceInfo data", self, :page => page.number)]
  else
    @issues = []
  end
end