rmagick を通過する前の PDF では、すべて問題なく表示されます。
しかし、rmagick を通過した後の品質はひどいものです。
どうしたの?全然圧縮してません。メソッドは次のとおりです。
def create_pdf_image
@document = Document.find(params[:document_id])
ruler = 400
pdf = Prawn::Document.new(:page_size => [ruler, ruler], :margin => 0, :optimize_objects => true)
@document.post_pdf(pdf, ruler)
temp = "#{@document.user.name.downcase.parameterize.underscore}-#{@document.id}"
pdf.render_file("#{::Rails.root}/public/#{temp}.pdf")
image = Magick::ImageList.new("#{::Rails.root}/public/#{temp}.pdf")
image.strip!
image.write("#{::Rails.root}/public/#{temp}.jpg") { self.quality = 100 }
send_file("#{::Rails.root}/public/#{temp}.jpg")
end
どんな助けでもいいです。ありがとう!