Question

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.

No correct solution

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top