Skip to content

Specifying resolution of images of PDFs

dertel edited this page Sep 18, 2019 · 1 revision

Some PDFs might convert to raster image formats at a low resolution by default. Use the --dpi flag to increase the resolution of the raster output.

Vips

pipeline = ImageProcessing::Vips
  .source(pdf_path)
  .convert("jpg")

# renders the first page at 300 dpi
image = pipeline.loader(dpi: 300, page: 0).call