Class: ComicBook::PDF::Extractor
- Inherits:
-
Object
- Object
- ComicBook::PDF::Extractor
- Defined in:
- lib/comic_book/pdf/extractor.rb
Constant Summary collapse
- DEFAULT_DPI =
300
Instance Method Summary collapse
- #extract(options = {}) ⇒ Object
-
#initialize(pdf_path) ⇒ Extractor
constructor
A new instance of Extractor.
Constructor Details
#initialize(pdf_path) ⇒ Extractor
Returns a new instance of Extractor.
6 7 8 |
# File 'lib/comic_book/pdf/extractor.rb', line 6 def initialize pdf_path @pdf_path = File. pdf_path end |
Instance Method Details
#extract(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/comic_book/pdf/extractor.rb', line 10 def extract = {} extension = .fetch :extension, :cb delete_original = .fetch :delete_original, false @dpi = .fetch :dpi, DEFAULT_DPI destination = [:to] || determine_extract_path(extension) create_destination_directory destination render_pages destination cleanup_pdf_file if delete_original destination end |