Class: Stevedore::Pdf

Inherits:
Object
  • Object
show all
Defined in:
lib/stevedore/pdf.rb

Defined Under Namespace

Classes: Image, Metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Pdf

Returns a new instance of Pdf.



4
5
6
# File 'lib/stevedore/pdf.rb', line 4

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



2
3
4
# File 'lib/stevedore/pdf.rb', line 2

def file_path
  @file_path
end

Instance Method Details

#images(base_dir = tmp_dir) ⇒ Object



43
44
45
# File 'lib/stevedore/pdf.rb', line 43

def images(base_dir = tmp_dir)
  @images ||= Image.extract_all(self, base_dir)
end

#metadataObject



8
9
10
# File 'lib/stevedore/pdf.rb', line 8

def 
  @metadata ||= Metadata.new(self)
end

#num_pagesObject



12
13
14
# File 'lib/stevedore/pdf.rb', line 12

def num_pages
  .num_pages
end

#page_sizeObject



16
17
18
# File 'lib/stevedore/pdf.rb', line 16

def page_size
  .page_size
end

#tmp_dirObject



47
48
49
# File 'lib/stevedore/pdf.rb', line 47

def tmp_dir
  @dir ||= Dir.mktmpdir
end