View Source PDF2Image (PDF2Image v0.1.0)
Summary
Functions
Convert a PDF file (on disk) to an image (in memory). Supported options
Types
@type option() :: {:device, term()} | {:resolution, pos_integer()} | {:page, pos_integer()} | {:fit_page, boolean()} | {:crop, boolean()}
Functions
@spec convert(binary(), option()) :: {:ok, Vix.Vips.Image.t()} | {:error, term()}
Convert a PDF file (on disk) to an image (in memory). Supported options:
:device
- The ghostscript device (aka output format) to use (default: pnggray) The default value is"pnggray"
.:resolution
(pos_integer/0
) - The resolution of the output image in DPI (default: 150) The default value is150
.:page
(pos_integer/0
) - The page number to convert (default: 1) The default value is1
.:fit_page
(boolean/0
) - Fit the page size of the current device. Setsghostscript
option-dPDFFitPage
. (default: true) The default value istrue
.:crop
(boolean/0
) - Crop the output to the bounding box. Setsghostscript
option-dEPSCrop
. (default: true) The default value istrue
.