We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86881ae commit 552a4dbCopy full SHA for 552a4db
lib/pdf_to_jpg.rb
@@ -11,10 +11,10 @@ def pdf_to_jpg(pdf_location)
11
12
pdf = Magick::ImageList.new(pdf_location)
13
14
- pdf.each do |page|
15
- 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"
16
#write the JPG files to the directory specified
17
- pdf[page].write(write_filename)
+ pdf[i].write(write_filename)
18
#appends full filename to array
19
converted_jpgs << write_filename
20
end
0 commit comments