code_junkie

Convert a .doc or .pdf to an image and display a thumbnail in Ruby?

Nov 10th, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. require 'RMagick'
  2. pdf = Magick::ImageList.new("doc.pdf")
  3. thumb = pdf.scale(300, 300)
  4. thumb.write "doc.png"
  5.  
  6. ´convert -size 300x300 doc.pdf doc.png´
Add Comment
Please, Sign In to add comment