I've been looking through Vips and Ruby-Vips documentation, and I am not seeing anyway to load and convert a PDF. Imagemagick has the convert command in their CLI tools. Is there an equivalent to convert in Vips? My goal is to convert a PDF to a jpeg in my Rails 3 app.

没有正确的解决方案

其他提示

You can open a PDF like any other image file.

a = Vips::Image.new_from_file "/some/file/called.pdf", access: :sequential
a.write_to_file("tiny.jpg")

Optional arguments let you set a rendering resolution, a background colour, and pick a page or set of pages.

The docs for pdfload explain all the options:

https://libvips.github.io/libvips/API/current/VipsForeignSave.html#vips-pdfload

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top