Created
May 13, 2013 14:33
-
-
Save songjiayang/5568731 to your computer and use it in GitHub Desktop.
pdf to image..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#方法一: Pdf To Images | |
# 将pdf 转化为image,主要用的Magick,找到两个方法,基本都相同 | |
#function1 | |
pdf =Magick::ImageList.new("test.pdf") | |
pdf.write("demo.jpg") | |
#function2 | |
pdf= Magick::Image.read("test.pdf") | |
pdf.each_with_index do |image,index| | |
image.write("test-#{index.to_s}.jpg") | |
end | |
这个两个方法都是使用Magick来将pdf转化为images,基本相同,他们都存在一个问题就是转化出的image字体不是很清晰。。。待解决。。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment