Class: PDF::Burst
- Inherits:
-
Object
- Object
- PDF::Burst
- Defined in:
- lib/pdf/burst.rb,
lib/pdf/burst/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
- #generate_thumbnail? ⇒ Boolean
-
#initialize(pdf_path, options = {}) ⇒ Burst
constructor
A new instance of Burst.
- #page_count ⇒ Object
- #run! ⇒ Object
Constructor Details
#initialize(pdf_path, options = {}) ⇒ Burst
Returns a new instance of Burst.
3 4 5 6 7 8 |
# File 'lib/pdf/burst.rb', line 3 def initialize(pdf_path, ={}) @pdf_path = pdf_path @output_path = [:output] || "." @page_name = [:filename] || "page_%d" @thumbnail_size = [:thumbnail] end |
Instance Method Details
#generate_thumbnail? ⇒ Boolean
22 23 24 |
# File 'lib/pdf/burst.rb', line 22 def generate_thumbnail? !!@thumbnail_size end |
#page_count ⇒ Object
18 19 20 |
# File 'lib/pdf/burst.rb', line 18 def page_count `#{page_count_command}`.to_i end |
#run! ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pdf/burst.rb', line 10 def run! page_count.times do |i| page_number = i + 1 system burst_command(page_number) system thumbnail_command(page_number) if generate_thumbnail? end end |