Browse files

A little testing and refinement of the pdf-to-jpg conversion method

  • Loading branch information...
1 parent 86881ae commit 552a4db6dc33fee19668fda97cf518d34108db78 August committed Feb 28, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/pdf_to_jpg.rb
View
6 lib/pdf_to_jpg.rb
@@ -11,10 +11,10 @@ def pdf_to_jpg(pdf_location)
pdf = Magick::ImageList.new(pdf_location)
- pdf.each do |page|
- write_filename = tmp_location + "/" + file_name + "." + page.to_i + ".jpg"
+ pdf.each_with_index do |page, i|
+ write_filename = tmp_location + "/" + file_name + "." + i.to_s + ".jpg"
#write the JPG files to the directory specified
- pdf[page].write(write_filename)
+ pdf[i].write(write_filename)
#appends full filename to array
converted_jpgs << write_filename
end

0 comments on commit 552a4db

Please sign in to comment.