Constructor
VipsImagepdfload
Declaration [src]
int
vips_pdfload (
const char* filename,
VipsImage** out,
...
)
Description [src]
Render a PDF file into a VIPS image.
The output image is always RGBA — CMYK PDFs will be
converted. If you need CMYK bitmaps, you should use vips_magickload() instead.
Use page to select a page to render, numbering from zero.
Use n to select the number of pages to render. The default is 1. Pages are
rendered in a vertical column, with each individual page aligned to the
left. Set to -1 to mean “until the end of the document”. Use
vips_grid() to change page layout.
Use dpi to set the rendering resolution. The default is 72. Additionally,
you can scale by setting scale. If you set both, they combine.
Use background to set the background RGBA colour. The default is 255
(solid white), use eg. 0 for a transparent background.
Use password to supply a decryption password.
When using pdfium, the region of a page to render can be selected with
page_box, defaulting to the crop box.
The operation fills a number of header fields with metadata, for example “pdf-author”. They may be useful.
This function only reads the image header and does not render any pixel data. Rendering occurs when pixels are accessed.
::: tip “Optional arguments”
* page: gint, load this page, numbered from zero
* n: gint, load this many pages
* dpi: gdouble, render at this DPI
* scale: gdouble, scale render by this factor
* background: VipsArrayDouble, background colour
* page_box: VipsForeignPdfPageBox, use this page box (pdfium only)
::: seealso
vips_image_new_from_file(), vips_magickload().
Parameters
filename |
const char* |
File to load. |
|
| The data is owned by the caller of the function. | |
| The string is a NUL terminated UTF-8 string. | |
out |
VipsImage |
Output image. |
|
| The argument will be set by the function. | |
| The called function takes ownership of the data, and is responsible for freeing it. | |
... |
none |
|