1

i'm trying to convert a .pdf to a .jpeg using Vips version 7.26 with C++. but the quality output is very bad. Is there a way to set the resolution on read file process?

Note: Update Vips to newer versions it's not a solution

My Code

vips::VImage image ("path/to/pdf/name.pdf");
image.write ("path/to/pdf/name.jpeg");
Guilherme
  • 33
  • 4

1 Answers1

0

Wow, 7.26 is more than 10 years old, this feels like a trip back through time.

I had a look at the archives and libvips added PDF load in 2016 in version 8.3. Back in the days of 7.26 it would use imagemagick to load PDFs, and that in turn used GhostScript. There's no way (sadly) to pass rendering density from libvips 7.26 into ImageMagick. The various issues around PDF rendering in imagemagick are what forced us to implement our own loader.

tldr: you need to update to at least libvips 8.3, or find another PDF rendering solution.

jcupitt
  • 10,213
  • 2
  • 23
  • 39