Class: Bookshelf::Parser::PDF

Inherits:
Base
  • Object
show all
Defined in:
lib/bookshelf/parser/pdf.rb

Instance Attribute Summary

Attributes inherited from Base

#book_dir

Instance Method Summary collapse

Methods inherited from Base

#config, #initialize, #name, parse, #spawn_command

Constructor Details

This class inherits a constructor from Bookshelf::Parser::Base

Instance Method Details

#html_fileObject



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

def html_file
  Bookshelf.root_dir.join("output/#{name}.html")
end

#parseObject



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

def parse
  spawn_command ["prince", html_file.to_s, "-o", pdf_file.to_s]
end

#pdf_fileObject



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

def pdf_file
  Bookshelf.root_dir.join("output/#{name}.pdf")
end