Class: Ilovepdf::Tool::Pdfa

Inherits:
Ilovepdf::Task show all
Defined in:
lib/ilovepdf/tool/pdfa.rb

Constant Summary collapse

API_PARAMS =
[:conformance, :allow_downgrade]
CONFORMANCE_VALUES =
['pdfa-1b', 'pdfa-1a', 'pdfa-2b', 'pdfa-2u',
 'pdfa-2a', 'pdfa-3b', 'pdfa-3u', 'pdfa-3a'
]

Constants inherited from Ilovepdf::Task

Ilovepdf::Task::DOWNLOAD_INFO

Constants included from Ilovepdf

VERSION

Instance Attribute Summary

Attributes inherited from Ilovepdf::Task

#ignore_errors, #ignore_password, #output_filename, #packaged_filename, #result, #task_id, #tool, #try_pdf_repair

Instance Method Summary collapse

Methods inherited from Ilovepdf::Task

#add_file, #add_file_from_url, #assign_meta_value, #blob, #delete!, #delete_file, #download, #download_info, #enable_file_encryption, #execute, #files, #status

Methods included from Ilovepdf

root

Constructor Details

#initialize(public_key, secret_key) ⇒ Pdfa

Returns a new instance of Pdfa.



11
12
13
14
15
# File 'lib/ilovepdf/tool/pdfa.rb', line 11

def initialize(public_key, secret_key)
  self.tool = :pdfa
  super(public_key, secret_key)
  self.allow_downgrade = true
end

Instance Method Details

#conformanceObject



22
23
24
# File 'lib/ilovepdf/tool/pdfa.rb', line 22

def conformance
  @conformance ||= 'pdfa-2b'
end

#conformance=(new_val) ⇒ Object



17
18
19
20
# File 'lib/ilovepdf/tool/pdfa.rb', line 17

def conformance= new_val
  raise Errors::ArgumentEnumError.new(CONFORMANCE_VALUES) unless CONFORMANCE_VALUES.include? new_val
  @conformance = new_val
end