0
하나의 pdf에서 여러 이미지를 생성하고 싶습니다.여러 pdf를 여러 이미지로 변환
Heres는 내 논리 :
has_attached_file :single_magazin,
:styles => {:for_magazine => ["768x1200>", :jpg], :preview => ["725x1200>", :jpg], :thumb => ["100x140>", :jpg] },
:processors => [:ghostscript, :thumbnail],
:convert_options => { :all => '-colorspace RGB -flatten -density 300 -quality 100' },
:path => ":rails_root/public/system/:class/:attachment/:id_partition/:style/:filename"
validates_attachment_content_type :single_magazin,
:content_type => [ 'application/pdf' ],
:error => "only pdf files are allowed"
내가 여러 페이지를 하나의 PDF를 업로드하려면, 내가 출력 다수의 JPG 년대합니다. 각 페이지를 하나의 JPG로 만듭니다.
내가 레일 4
를 사용하고 난 고스트 스크립트와 ImageMagick이 설치되어 있어야합니다.
도와주세요.
마르쿠스
중복 됨. 확인 : http://stackoverflow.com/questions/25503735/convert-pdf-to-image-as-per-the-pdf-page/ – pedrofs